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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

How can I add dynamic currency prefix in sales field to show it in a bar chart ?

I wanted to add "$" & "" prefix in sales field that changes according to the currency filter selected by user ($ if USD is selected, € if EUR is selected)

 

Any suggestion or help would be helpful to me. Thanks. 

7 REPLIES 7
PC2790
Community Champion
Community Champion

Try this way:

1) Add a new column for Amount in Euros which will do the calculation by picking the amount in USDs

2) Unpivot it so that a table will have both the values(in USDs and EUROS)

3) Create an independent table for slicer selection which you need to join with others

4) Use that table for having a slicer.

Sample file attached here

Anonymous
Not applicable

Thanks for your reply but this will not work in case of bar chart because the result is text and we are loosing the knowledge of the value.

I want this to be done in case of bar chart showing sales of different products.

Hello @Anonymous ,


In the above solution given by @PC2790 , please change datatype of Values column to Decimal format, and you should be good to go. 

As you need to show values in bar chart, I would suggest you to go with this approach instead of prefixing Currency symbol in starting.

 

Cheers,

Shishir

Cheers,
Shishir
Anonymous
Not applicable

so there is no way I can show dynamic currency prefix with the value in bar chart?

PC2790
Community Champion
Community Champion

As a workaround you can create a measure to have dynamic header according to the slicer selection of the currenycy

For Eg, when you select USD,  the header should show "Value in USD"

Or see if these videos from Gy in a cube turns out to be helpful:

Dynamically change chart axis in Power BI - YouTube

Dynamic titles with multiple slicers or filters in Power BI - YouTube

Shishir22
Solution Sage
Solution Sage

Hello @Anonymous ,

 

Please add a independent table with name CurrencyType having two values as type- Euro and Dollar.

Use this feild in slicer.

 

Lets assume that you have measure which gives you amount/sales column as Measure1.

 

Use below measure for dynamically switching Dollar and Euro based on selction.

 

Measure = Switch(Selectedvalue(CurrecnyType[Currency]),"Euro",FORMAT([Measure1],"€#.00"),"Dollar",FORMAT([Measure1],"$#.00"))

 

 

Please mark it as answer if it solves your issue. Kudos are also appreciated.

 

Cheers,

Shishir

 

Cheers,
Shishir
Anonymous
Not applicable

Thanks for your reply Shishir but this will work only in table or matrix, I won't be able to use this for charts. This is becasue the result is text, we are loosing the knowledge of the value.

I want this to be done for a bar chart.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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