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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dom87326
Helper II
Helper II

Dynamic number format for Card visual

Hello, 

 

I want to set a dynamic format for Card that shows Revenue amount.

 

Revenue =
VAR _sumRev =
    CALCULATE ( SUM ( 'Fact'[Revenue] ) )
RETURN
    FORMAT (
        _sumRev,
        SWITCH ( TRUE (),
            LEN ( _sumRev ) + 1 - 1 > 8,
            //"#,##0.##", 
            LEN ( _sumRev ) + 1 - 1 < 8,
            //"#,##0.##"
        )
    )

 


If value is in billions, to display 1 000 000 K if it's less than billion, full number. 

Thanks for help!


1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Dom87326 , you should check like

 

return

Switch( True(),

_sumRev >1000000000, format(_sumRev/1000, "### ### ### \K")

_sumRev&""

)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Dom87326 , you should check like

 

return

Switch( True(),

_sumRev >1000000000, format(_sumRev/1000, "### ### ### \K")

_sumRev&""

)

Hey @amitchandak , 

Thanks for you reply, however format functions doesn't recognize specified format string "### ### ### \K" and I get text type result below for number <1000000000:
2021-11-28 15_32_50-PBI error.pngIs it possible to amend that and by adding currency symbol in the beginning and removing decimals?
My locale is set to English (UK) 

@Dom87326 , Add currency symbol in the format or append as string before

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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