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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors