cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dokat
Continued Contributor
Continued Contributor

Change number format based on its value

Hi,

 

I have formula that returns value in thousands or millions based on filter selection. Is it possible to format it based on the value with dax formula. For Ex: If the selection returns 500000, it formats $500K, if its $5,000,000, returns $5.0M. Below is the formula use.

 

Net Sales = CALCULATE(('P&L'[2021]), 'P&L'[P&L] in { "Customer NS"})
 
Appreciate anyone who has a solve for it.
1 ACCEPTED SOLUTION
dokat
Continued Contributor
Continued Contributor

I modified the formula and tried below and its working

 

Testmeasure = VAR NetSales = SUM([Values])
RETURN
SWITCH(TRUE(),
[Net Sales] <1000000, FORMAT('P&L'[Net Sales],"$#0,K"),
[Net Sales] >=1000000, FORMAT('P&L'[Net Sales],"$#,##,,.0M"),
FORMAT('P&L'[Net Sales],"##,##0")
)

View solution in original post

2 REPLIES 2
dokat
Continued Contributor
Continued Contributor

I modified the formula and tried below and its working

 

Testmeasure = VAR NetSales = SUM([Values])
RETURN
SWITCH(TRUE(),
[Net Sales] <1000000, FORMAT('P&L'[Net Sales],"$#0,K"),
[Net Sales] >=1000000, FORMAT('P&L'[Net Sales],"$#,##,,.0M"),
FORMAT('P&L'[Net Sales],"##,##0")
)
ALLUREAN
Super User
Super User

Hi, @dokat 

Not sure if I understand it correctly, but you can set to display Auto in visual options for this measure?




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!