Reply
asodie
Helper I
Helper I
Partially syndicated - Outbound

Vega lite - Show number in Billions with B instead of G

I am trying to format the numbers in this axis in the millions/billions, and I want it to show more labels. However, I am having an issue. When I try "format": "$,.2s" it works fine, except it shows G instead of B for billions. I know this is scientifically correct, but my colleagues will expect B for billions. Is there any way to change the G to B?

 

asodie_1-1707860492559.png

 

The other possible solution would be to only show millions. So instead of $1.2G it would show $1,200M. 

Please let me know any suggestions! Thanks!

7 REPLIES 7
v-heq-msft
Community Support
Community Support

Syndicated - Outbound

Hi @asodie ,
You can use custom format strings in Power BI Desktop, which allows you to define the format of your columns.
Go to Model view -> Choose the target column -> Formatting -> Format

vheqmsft_0-1708416248771.png

$#0,,,B

Final output

vheqmsft_1-1708416286671.png

 

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Syndicated - Outbound

Hi, 

 

Thanks for your answer. This seems to work well if all numbers are in billions, but my numbers range from 0 to the billions. It also doesn't seem to have an effect on Vega-lite visuals.

Daniel29195
Super User
Super User

Syndicated - Outbound

@asodie 

is it possible that you can use the dynamic format feature for the measure  ? 

Daniel29195_0-1707862115815.png

 

 

let me know if this helps. 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

Syndicated - Outbound

Thanks for this option. I haven't used dynamic formatting before, can you provide more details on how you connected that dynamic formatting measure to the currency column?

Syndicated - Outbound

@asodie 

when you select a measure

go to measure tools  -->  format --> chose dynamic .

Daniel29195_0-1707947228406.png

 

 

now you can alternate between the measure and format

Daniel29195_1-1707947260563.png

 

 

you can use switch for formatting, example,

if less than billion, format it this way, 

if more than 1 billion, format it another way .

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Syndicated - Outbound

Does it work for a column? The currency value I am using is a column, not a measure. Can I connect the dynamic formatting measure to the column?

Syndicated - Outbound

@asodie 

 

unfortunately you cant for a column, 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)