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.
Hi, I need to show different units for a value based on user selection (Thousands (K), Millions(M), Billions(B),
I have created the measure that gives the result that needs to be formatted: to have this result, the user selects from a slicer that contains 4 possible options and the formula returns the value.
Dmnd_Supply_Related_Test =
VAR val =
SWITCH(
TRUE,
SELECTEDVALUE('Slicer - Options'[Code]) = 1, SUM(pio_excess_rootcause_gei[Dmnd_supply_related]),
SELECTEDVALUE('Slicer - Options'[Code]) = 2, SUMX(tblSCHist_InvMetrics, tblSCHist_InvMetrics[excessGEI] * tblSCHist_InvMetrics[cost_aswas]),
SELECTEDVALUE('Slicer - Options'[Code]) = 3, SUM(pio_excess_rootcause_gei[excessContribution]),
SELECTEDVALUE('Slicer - Options'[Code]) = 4, SUM(pio_excess_rootcause_gei[UNIT_COST_LOCAL_Related_Sum])
)
RETURN
(val / SELECTEDVALUE('Slicer - Display Units'[Denominator]))
The value val returned in the switch part is divided by the units slicer that allows to select (Thousands, Millions, Billions) and it takes the denominator (1K, 1M, 1B) accordingly to have at the end the value.
The challenge comes when I try to use this value in a visual, let's say that the switch returns the first option evaluated and the user selected Millions in the slicer, the visual is returning the correct value, but I need to show for example (first bar from the chart below) 163.46 M and if is selected Thousands it should show at the end of the number the word "K" and "B" if Billions option is selected but I'm only getting the number without these words.
The Display units property of the visual is set to None, I have tried changing this property to Auto and other options but not getting the expected result, I have the feeling that I need to formatt directly from the formula in the return part but not sure how to formatt from there.
Any idea is highly appreciated,
Thanks,
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
39 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |