Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
asodie
Helper I
Helper I

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

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

 

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

@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! 🤠

 

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?

@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! 🤠

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?

@asodie 

 

unfortunately you cant for a column, 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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