Within a text mark, I want to format quantitative values (currency) according to these rules:
(1) and (3) can be done with pbiFormat.
"format": "$#0,,.M;;;@",
"formatType"
The default D3 formatter can do (2).
"format": "$~s"
How can I do all three at the same time?
You need to use PowerBI dynamic format strings for this. For any value, you feed into Deneb two columns - the raw numeric value (for quantitative data allowing you to encode in Vega) and a formatted text value for displaying labels. The dynamic format string for the text value would follow the usual format of:
SWITCH(TRUE(),
val <=1e3, "#,0.00",
val <=1e6, "#,0,.00 K",
val <=1e9, "#,0,,.00 M"
)