Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm having issues with a few measures I've created where visually, they are not being formatted the way I want them to be. Given specific values calculated by the measures, I need them to show up as such:
Measure = 25000, Card shows "25K"
Measure = 25100, Card shows "25.1K"
Measure = 2000000, Card shows "2M"
Measure = 2100000, Card shows "2.1M"
Right now, this is what I have as a rounding and formatting mechanism within the measure:
Solved! Go to Solution.
Hi @Anonymous ,
You could use the following formula:
Measure 2 =
VAR _countof0 =
LEN ( [Measure] ) - LEN ( SUBSTITUTE ( [Measure], "0", "" ) )
RETURN
IF (
_countof0 <= 2,
FORMAT ( ROUND ( [Measure] / 1000, 1 ), "$0.0" ) & "" & "K",
IF (
_countof0 > 2
&& _countof0 < 5,
FORMAT ( ROUND ( [Measure] / 1000, 1 ), "$#" ) & "" & "K",
IF (
_countof0 = 5,
FORMAT ( ROUND ( [Measure] / 1000000, 1 ), "$#.0" ) & "" & "M",
IF (
_countof0 > 5
&& _countof0 < 8,
FORMAT ( ROUND ( [Measure] / 1000000, 1 ), "$#" ) & "" & "M"
)
)
)
)
My output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Hi @Anonymous ,
You could use the following formula:
Measure 2 =
VAR _countof0 =
LEN ( [Measure] ) - LEN ( SUBSTITUTE ( [Measure], "0", "" ) )
RETURN
IF (
_countof0 <= 2,
FORMAT ( ROUND ( [Measure] / 1000, 1 ), "$0.0" ) & "" & "K",
IF (
_countof0 > 2
&& _countof0 < 5,
FORMAT ( ROUND ( [Measure] / 1000, 1 ), "$#" ) & "" & "K",
IF (
_countof0 = 5,
FORMAT ( ROUND ( [Measure] / 1000000, 1 ), "$#.0" ) & "" & "M",
IF (
_countof0 > 5
&& _countof0 < 8,
FORMAT ( ROUND ( [Measure] / 1000000, 1 ), "$#" ) & "" & "M"
)
)
)
)
My output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Thank you, Evelyn!
Try turning off the auto formatting in the card. I don't remember where it is, I think it is on one of the top few format menus.
I tried doing that and still had the same issue with the decimal point remaining. I would actually use the "Auto" feature, but they switch between none and two decimal places, not one, which is what I'm trying to accomplish.
User | Count |
---|---|
77 | |
76 | |
45 | |
31 | |
26 |
User | Count |
---|---|
98 | |
89 | |
52 | |
48 | |
46 |