Forum Discussion

RFraess's avatar
RFraess
Regular Visitor
3 years ago
Solved

Issue with formatting numbers in cards

I am trying to use the following format string expression to format numbers in cards and donut charts, and I am having issues with any numbers >=100k and <1M. The formatting works in a table or a multi-row card, but not in a card or a donut chart.

Format String Expression:

SWITCH ( TRUE (), SELECTEDMEASURE() < 100000, "$#0,.0K", SELECTEDMEASURE() >= 100000 && SELECTEDMEASURE() < 1000000 , "$#,.K", SELECTEDMEASURE() >= 1000000 && SELECTEDMEASURE() < 10000000 , "$#,##,,.00M", SELECTEDMEASURE() >= 10000000 , "$#,##,,.0M", "")


Here are the measures in cards with formatting off:

Here are the measures in cards with the formatting on:

The bottom label is how I would like to numbers to be formatted.

 

Here is a table with the formatting off:

And here is a table with the formatting on:

The formatting in the table is successful, but the formatting in the card is not.

If I change the card to a multi-row card the formatting works:

The same problem happens in a donut chart. Here is the unformatted donut chart:

 

And here is the formatted donut chart:

 

Thanks in advance for any insight.