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
gjadal
Employee
Employee

Format currency to millions and thousands symbol based on the value

I have a column in a table matrix visual which contains different types of data like Currency, Units, %.

Is there a way to dynamically set the format of the values using Format.

For example if it is currency and value is 100, I need $100 but if the value is bug like  10120 then i want it displayed as $10.12K

Similarly for Units I need the K and M symbol if the value gets larger.

Also wanted a better way to set the format to a % or $ based on the type. Is there a ready function available or do I need to write DAX with all the SWITCH statements?

 

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

@gjadal,

 

I'm afraid currently there's no such option in Currency Format in the Modeling pane. As a workaround, you can use switch function to achieve that.

Column = 
SWITCH (
    TRUE (),
    Table1[Currency] < 1000, CONCATENATE ( "$", Table1[Currency] ),
    Table1[Currency] >= 1000, CONCATENATE ( "$", CONCATENATE ( Table1[Currency] / 1000, "K" ) ),
    Table1[Currency] >= 1000000, CONCATENATE ( "$", CONCATENATE ( Table1[Currency] / 1000000, "M" ) )
)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

7 REPLIES 7
guptav13
Frequent Visitor

If I am exporting it to excel I can not work with these formatted numbers as they are string now, is there a way to get the output as numbers

danielgajohnson
Helper II
Helper II

Has anyone found a way to do this that allows for aggregation functions on that column? I can't SUM the resulting column because it's now a string.

v-yuta-msft
Community Support
Community Support

@gjadal,

 

I'm afraid currently there's no such option in Currency Format in the Modeling pane. As a workaround, you can use switch function to achieve that.

Column = 
SWITCH (
    TRUE (),
    Table1[Currency] < 1000, CONCATENATE ( "$", Table1[Currency] ),
    Table1[Currency] >= 1000, CONCATENATE ( "$", CONCATENATE ( Table1[Currency] / 1000, "K" ) ),
    Table1[Currency] >= 1000000, CONCATENATE ( "$", CONCATENATE ( Table1[Currency] / 1000000, "M" ) )
)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Looks to me that the clauses inside the Switch have to be in the opposite Order, Especially for conditions 2 and 3. The way it is ordered here, you'll never get to condition 3 as conditions 1 and 2 cover all the possible numbers

Anonymous
Not applicable

Good stuff and here's a little improvement on the value range to which a conversion applies and to round to 2 decimals only

 

Column =
SWITCH (
    TRUE (),
    Table1[Currency] < 1000, CONCATENATE ( "$", Table1[Currency] ),
    AND(Table1[Currency] >= 1000, Table1[Currency] < 1000000), CONCATENATE ( "$", CONCATENATE (  ROUND(Table1[Currency] / 1000, 2), "K" ) ),
    Table1[Currency] >= 1000000, CONCATENATE ( "$", CONCATENATE ( ROUND(Table1[Currency] / 1000000, 2), "M" ) )
)

Great program, but now that we have a string, how do we sort the K and M numbers to make sense?  Thx

Hi,

 

Is above is resolved or not?
If resolved kindly please share me the resolution here.
Thanks

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.