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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
yjlee1212
Frequent Visitor

How do I show fixed number of digits on a card

Hello,

 

My client asked if the card can show 3 digits no matter what the numbers are.

For example, for the cards, the numbers are showing up with automatic unit display: 4M, 133K, 3000, 100, etc. 

The client asked if I can make the card always show 3 significant digits and I don't know how to do it.

He is expecting for 4M number in the card, it should show 4.XXM now but for 133K, it should stay the same without any decimal number. 

 

Is there a way for me to achieve what is being asked over here? 

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @yjlee1212 ,

 

you can check the numbers and then return a different value with the FORMAT string.

A while ago I wrote a blog article how you can do a automatic scaling (give back as Billion, Million, Thousand or without any scaling):

Dynamic scaling of a measure in Power BI with DAX - What the fact.bi

 

The mechanism should be the same for you, something like this should work for you:

SUM Sales dynamic =
VAR _SumSales = SUM( FactInternetSales[SalesAmount] ) 
VAR _FormattedSales = SWITCH(
    TRUE(),
    _SumSales < 1000000, FORMAT( _SumSales, "000, K" ),
    _SumSales < 10000000, FORMAT( _SumSales, " 0 , , .00 Mil" ),
    _SumSales
) 

RETURN
_FormattedSales

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @yjlee1212 ,

 

you can check the numbers and then return a different value with the FORMAT string.

A while ago I wrote a blog article how you can do a automatic scaling (give back as Billion, Million, Thousand or without any scaling):

Dynamic scaling of a measure in Power BI with DAX - What the fact.bi

 

The mechanism should be the same for you, something like this should work for you:

SUM Sales dynamic =
VAR _SumSales = SUM( FactInternetSales[SalesAmount] ) 
VAR _FormattedSales = SWITCH(
    TRUE(),
    _SumSales < 1000000, FORMAT( _SumSales, "000, K" ),
    _SumSales < 10000000, FORMAT( _SumSales, " 0 , , .00 Mil" ),
    _SumSales
) 

RETURN
_FormattedSales

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Hello @selimovd 

 

Thanks for showing me the solution. This was exactly what I needed. I made some minor addition to the logic and it works like a magic! I really appreciate it!.

 

Regards,

Yong-Jin

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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