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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Nun
Resolver I
Resolver I

convert category in local currency into EUR with a specific category rate

Hello,

 

please can someone support to solve this issue?

I have a table

Sales Lc SalesEUR Category Currency code

100        10            Pre          ARS

200        20            Pre          ARS

500       70             After       ARS

250      40             After        ARS

350    100             After        BRL

500   250              Pre          BRL

 

I need to create a measure where the currency rate is calculated based a "Pre" category (if we consider the currency code = "ARS", the currency rate is 300/30 =10), but appied for the category "After" and Sales Lc. In pratic once is defined the currency rate, moltiply for the column "Sales Lc" which the category = "After".

the result of the measure, in case of currency code ARS is 750(Sales LC with category "After")/10 (currency rate calculated based on sales LC with category "Pre")= 75

for Currency BRL, for example, should me a measure 350/2,5

 

Thanks!

2 ACCEPTED SOLUTIONS

@Nun 

if you have a filter of category, you can try this

Measure = 
VAR a=CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Currency code]),'Table'[Category]="Pre"))/CALCULATE(SUM('Table'[SalesEUR]),FILTER(ALLEXCEPT('Table','Table'[Currency code]),'Table'[Category]="Pre"))
return SUM('Table'[Sales])/a

1.PNG





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

Proud to be a Super User!




View solution in original post

@Nun 

you can create another measure

Measure 2 = SUMX('Table',[Measure])

1.PNG





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@Nun 

you can try this

Measure = 
VAR a=CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Category]="Pre"))/CALCULATE(SUM('Table'[SalesEUR]),FILTER('Table','Table'[Category]="Pre"))
return CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Category]="After"))/a

1.PNG





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

Proud to be a Super User!




@ryan_mayu 

 

thanks for supporting.

Using your measure, when I filter "After", the result I get is "infinity". it looks like

CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Category]="After"))/a

a is 0 when in a table I have the measure and I would like to see(I use a filter visualization) the result of "After".

Thanks!

@Nun 

if you have a filter of category, you can try this

Measure = 
VAR a=CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Currency code]),'Table'[Category]="Pre"))/CALCULATE(SUM('Table'[SalesEUR]),FILTER(ALLEXCEPT('Table','Table'[Currency code]),'Table'[Category]="Pre"))
return SUM('Table'[Sales])/a

1.PNG





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

Proud to be a Super User!




@ryan_mayu 

hello,

I used your formula, but when I check the results, are incorrect especially the total.

The formula works but the results are incorrect. In your as total you get 385 when the correct result is 250, as well the result in the measure for some currencies are not correct.

Thanks!

@Nun 

you can create another measure

Measure 2 = SUMX('Table',[Measure])

1.PNG





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

Proud to be a Super User!




Great!!!

Thanks a lot @ryan_mayu !!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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