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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Bharathi_99
Helper V
Helper V

Formatting numbers to B, M, K dynamically based on values in bar chart

Hello All,

I am trying to get value lables in below picture in power BI bar chart, my Y-AXIS measure is EntryCount=Count(Table[EntryNumber]).
If my number value is in millions show it in millions , if like 0.4M show it as 400k like this 

Bharathi_99_0-1729584296763.png


Please help,
Thanks




1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @Bharathi_99 ,
Thanks for his reply. His measure is available, but one thing I need to correct is that in this case, the y-axis accepts a numeric type and the format casts it to a text type, which is why the outright substitution is unsuccessful. The correct application is visualizations -> Format your visual ->Data lablesv -> Value, apply this measure to the filed box

vheqmsft_0-1729652734275.png

Final output

vheqmsft_1-1729652752332.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

 

 

View solution in original post

3 REPLIES 3
v-heq-msft
Community Support
Community Support

Hi @Bharathi_99 ,
Thanks for his reply. His measure is available, but one thing I need to correct is that in this case, the y-axis accepts a numeric type and the format casts it to a text type, which is why the outright substitution is unsuccessful. The correct application is visualizations -> Format your visual ->Data lablesv -> Value, apply this measure to the filed box

vheqmsft_0-1729652734275.png

Final output

vheqmsft_1-1729652752332.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

 

 

bhanu_gautam
Super User
Super User

@Bharathi_99 , You can create a measure 

 

If you want to customize the display units further, you can use a DAX measure to format the values. 
FormattedEntryCount =
VAR EntryCountValue = [EntryCount]
RETURN
SWITCH(
TRUE(),
EntryCountValue >= 1000000, FORMAT(EntryCountValue / 1000000, "0.0M"),
EntryCountValue >= 1000, FORMAT(EntryCountValue / 1000, "0K"),
FORMAT(EntryCountValue, "0")
)


Use the Custom Measure:
Replace your Y-axis measure with the new FormattedEntryCount measure.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






I cannot able to add above measure in Y-AXIS, when i am dragging it directly going and placing in Tooltips, 
why it's happening like this any idea?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.