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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Format Column which has multiple currencies with correct currency symbol

Hi,

 

I've got a table as below:

Order DateNet SaleCurrencyCountry
12/01/2021100USDUS
12/01/2021200USDUS
13/01/2021300USDUS
12/01/202150GBPUK
12/01/202150GBPUK
13/01/202170GBPUK

 

This table then gets summarized into total sales for each day by summing the "Net Sale" column.  Ultimately, there'll be seperate dashboards for each country.

 

What I want is the below table with the $ symbol when the currency is USD and the £ symbol when the currency is GBP. We can assume that each country uses just one currency for our case.

 

Table:

Order DateNet Sale
12/01/2021$300
13/01/2021$300
12/01/2021£100
13/01/2021£70

 

What I've tried but doesn't seem to work:

1. Use the Formatting option on the "Net Sales" variable. However, this only let's you choose either $ or £ and doesn't allow logic.

evan_lmi_1-1642109122631.png

2. Creating a new column with DAX code such as:

evan_lmi_4-1642109642373.png

I did try some other DAX code which formatted it with the correct currency symbol but then it turned the variable into a text data format and so you can't summarize the numbers. 

 

Is there anyway to do this? Another way I could do it is just duplicate the NET_SALES column and call it NET_SALES_UK and NET_SALES_US, then apply differnet formatting to each column but I thought this is kind of a waste and surely there should be another way for example if I had 10 different currencies then I would have to duplicate the column 10 times.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Maybe you can try the following methods.

Measure:

Measure = 
CONCATENATE (
    IF (
        SELECTEDVALUE ( 'Table'[Currency] ) = "GBP", "£",
        IF ( SELECTEDVALUE ( 'Table'[Currency] ) = "USD", "$" )
    ),
    CALCULATE (
        SUM ( 'Table'[Net Sale] ),
        FILTER (
            ALL ( 'Table' ),
            [Order Date] = MAX ( 'Table'[Order Date] )
                && [Country] = MAX ( 'Table'[Country] )
        )
    )
)

vzhangti_0-1642470640305.png

If a new currency appears, you can then write it in the IF function.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

Maybe you can try the following methods.

Measure:

Measure = 
CONCATENATE (
    IF (
        SELECTEDVALUE ( 'Table'[Currency] ) = "GBP", "£",
        IF ( SELECTEDVALUE ( 'Table'[Currency] ) = "USD", "$" )
    ),
    CALCULATE (
        SUM ( 'Table'[Net Sale] ),
        FILTER (
            ALL ( 'Table' ),
            [Order Date] = MAX ( 'Table'[Order Date] )
                && [Country] = MAX ( 'Table'[Country] )
        )
    )
)

vzhangti_0-1642470640305.png

If a new currency appears, you can then write it in the IF function.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DAX has worked but the data type is text and now i can not calculate average and sum. Please help with that

@v-zhangti  please help

Greg_Deckler
Super User
Super User

@Anonymous I'm thinking two columns like this:

US Currency Column = IF([Country] = "US",[Net Sale],BLANK())

UK Currency Column = IF([Country] = "UK",[Net Sale],BLANK())

Format each column with the correct currency and use in your visuals.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg, I wanted to avoid creating 2 columns for each country for example if we had 10 currencies, I would have to make 10 new columns but if that's the only way then so be it.

VahidDM
Super User
Super User

Hi @Anonymous 

 

check this link:

https://www.sqlbi.com/articles/currency-conversion-in-power-bi-reports/

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Anonymous
Not applicable

Hi Vahid,

 

That looks promising but it says calculation groups are not available in Power BI. Thus, currently the remaining part of this article can only be implemented in Azure Analysis Services or Analysis Services 2019

They are now supported in power bi. You do however have to set them

up using tabular editor.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@Anonymous 

 

Do you want two calculated tables or a measure?

 

Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Anonymous
Not applicable

Just a single measure. For the visualisation, I will have 2 seperate tables which will be just filtered on country. I have updated my post to make this more clear.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.