This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
hey all,
So I'm running into a issue with creating a simple measure that has dynamic units ( thousands (k) up to billions (B))
I'm using the switch function, but it doesn't seem to be working.
VAR Amt = [raw Payment Amount]
RETURN
SWITCH(
TRUE(),
Amt >= 1000000000, FORMAT(Amt / 1000000000, "$#,##0.0") & "B",
Amt >= 1000000, FORMAT(Amt / 1000000, "$#,##0.0") & "M",
Amt >= 1000, FORMAT(Amt / 1000, "$#,##0.0") & "K",
FORMAT(Amt, "$#,##0.0")
I created a test measure, and every time it gives me "Less than Thousand"... even when the raw displays more... so it's something about Amt not being seen as a value?....but if i do a simple Amt / 1000...that works fine.
TestDivision =
VAR Amt = [raw Payment Amount]
RETURN
SWITCH(
TRUE,
Amt > 1000000000, "Billion",
Amt >= 1000000, "Million",
Amt > 100, "Thousand",
ISBLANK(Amt),"",
"Less than Thousand"
I'm a little stumped, if anyone has any suggestions, that would be appreciated (sorry I can't share the .pbix!)
Solved! Go to Solution.
Hi! Try this:
I have my base measure [Total], then I made this measure to switch how it would display:
DynamicDisplayUnits =
SWITCH(
TRUE(),
[Total] >= 1000000000, FORMAT([Total] / 1000000000, "0.0B"),
[Total] >= 1000000, FORMAT([Total] / 1000000, "0.0M"),
[Total] >= 1000, FORMAT([Total] / 1000, "0.0K"),
FORMAT([Total], "0")
)
Proud to be a Super User! | |
Omg...my brain is apparently done for the day...it was negative amount, therefore of course my measure wasn't working... thanks for the help @audreygerred
My pleasure! Happy to help!
Proud to be a Super User! | |
Hi! Try this:
I have my base measure [Total], then I made this measure to switch how it would display:
DynamicDisplayUnits =
SWITCH(
TRUE(),
[Total] >= 1000000000, FORMAT([Total] / 1000000000, "0.0B"),
[Total] >= 1000000, FORMAT([Total] / 1000000, "0.0M"),
[Total] >= 1000, FORMAT([Total] / 1000, "0.0K"),
FORMAT([Total], "0")
)
Proud to be a Super User! | |
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 18 | |
| 17 |
| User | Count |
|---|---|
| 62 | |
| 35 | |
| 34 | |
| 24 | |
| 24 |