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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
arca123
Advocate I
Advocate I

Data label ''Display units'' limiting to thousands or none when applicable

Hi all!
I have simple sales data that I am trying to show in a bar chart visual. I am trying to manipulate what kind of units does the visual use, depending on the applied filters. What should be my approach to achieve this?
Here is sample data I am working with:

IDColorPrice
1Red80000
2Red140000
3Red30000
4Red180000
5Red50000
6Red160000
7Blue768

 

I have created a simple measure: Sales = sum(Sheet1[Price])

And this is how PBI displays it:
Ekrānuzņēmums 2023-07-17 103253.png

For my use case, "0,64M" is not very descriptive, and I need to see it in thousands. I see two options to do this:
1) Changing the units in ''X-axis'' to thousands.

2) Changing the units in ''Data labels'' to thousands.
However, when I select the slicer to show only sum of items sold with ''Blue'', both options will still display the value in thousands:

Ekrānuzņēmums 2023-07-17 103953.png

This is also not very descriptive, in this case I would want to see ''None'' units applied. 

Would there be any solution which lets me change the displayed units based on some conditions?

 

Thank you all in advance!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User
3 REPLIES 3
johnt75
Super User
Super User

Hi @johnt75 

This is a great feature I was not aware of! This will help me a lot in future, thanks for sharing it!
Although, I can't fully figure it out. 
I have written a simple format measure: if (SELECTEDMEASURE() <= 10000, "#0", "#,##0,")
So, if the measure is less than 10000, none units are displayed and if it's higher than 10000 then thousands are displayed. Works wonderfully! However, I can't figure out how to add the ''K'' in this measure to indicate that those are thousands. 

According to the custom format strings https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings I should add a backslash or double quotation marks to display a character. However, editing the measure to 

1) if (SELECTEDMEASURE() <= 10000, "#0", "#,##0,\K") breaks the measure and none units are displayed in both cases

2) if (SELECTEDMEASURE() <= 10000, "#0", "#,##0,"K"") breaks the measure and my visualizations can no longer be displayed

3) if (SELECTEDMEASURE() <= 10000, "#0", "#,##0, K") also breaks the measure although it seems to work in the link you provided.

Any suggestions with how to solve this?

Try

IF ( SELECTEDMEASURE() <= 10000, "#0", "#,0,.00 K" )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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