Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
sbw666
Regular Visitor

Dynamic units on a currency measure

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.

 the [raw Payment Amount] measure is definitely formatted as currency (I've also tried it formated as a value) I've also tried Amt=value([raw Payment Amount])
 
Payment Amt (dynamic unit) =

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!)

1 ACCEPTED SOLUTION
audreygerred
Super User
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")
)

audreygerred_0-1742414737198.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
sbw666
Regular Visitor

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!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





audreygerred
Super User
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")
)

audreygerred_0-1742414737198.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.