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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hmokkapati
Helper II
Helper II

Change DAX measure format based on Market selection

Hello,

 

I have the below sample data model with different countries and Prices in those countries in the same table. 

 

currency table.GIF

 

We are not planning to do the Currency Conversion, but display the amounts in its local currency once the user selects the Market.

 

currency selection.GIF

 

I wrote the below measure which works fine for Card kind of displays but not Column/Line Charts as it is a Text and not a number/currency format.

 

Total With Conversion = if (
FIRSTNONBLANK(CurrencyConversionTest[Market],1) = "France" || FIRSTNONBLANK(CurrencyConversionTest[Market],1) = "Germany", Format([TotalCurrency],"€#,##0") ,
if (
FIRSTNONBLANK(CurrencyConversionTest[Market],1)= "Australia", Format([TotalCurrency],"$#,##0"),
if (FIRSTNONBLANK(CurrencyConversionTest[Market],1)= "UK", Format([TotalCurrency],"£#,##0"))
)
)

 

How can I change the format to be a number so i can use this in Column/Bar charts too? Or is there some other approach that I need to follow and change my model? 

 

Please advise.

 

Thank You,

Harisha

1 ACCEPTED SOLUTION

That is surely most elegant solution for now. Cheers!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

Goto modelling tab and change it to number format (Whole number etc)

 

model.PNG



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello parry2K

 

It wouldn't let me because of the way the Measure is written it treats it as "Text. The other options are disabled to choose.

 

The requirement is to be able to change the format of the measure to different currencies based on the country selected in the slicers.

 

Thank You,

Harisha

Quick question, seems odd but do you want chart to show mixed currencies?

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sean
Community Champion
Community Champion

@parry2kThe way I read the question is that @hmokkapati wants

a SINGLE COLUMN that will display the VALUES as data type NUMBER but formatted as different currencies on EACH ROW

 

EDIT: So he has 1 Column with numbers and he wants the values on the rows within that 1 column to be formatted differently?

 

EDIT2: @hmokkapati

Regarding the chart what you can do is plot a total measure without the conversion and then don't display the labels

And then place your measure with the conversion in the tooltips

Granted that's not what you want - but you'll be plotting numbers and the tooltips will show those numbers as formatted text!

Yeah @Sean I noticed that. As you suggested, Tooltip seems to be the best solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello,

 

Thanks for your replies.

 

For now, planning to display a label below the charts which mentions the currency format (for ex: Sales in USD ($) or Sales in Euros (€) ) when the user selects the Market. The label content is built using a Measure.

 

Still would like to know if there is a workaround.

 

Thank You,

Harisha 

That is surely most elegant solution for now. Cheers!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sorry forgot to mention, User would select only one Market at a time.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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