Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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!
Solved! Go to Solution.
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
Proud to be a Super User!
you can create another measure
Measure 2 = SUMX('Table',[Measure])
Proud to be a Super User!
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
Proud to be a Super User!
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!
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
Proud to be a Super User!
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!
you can create another measure
Measure 2 = SUMX('Table',[Measure])
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
61 | |
36 | |
32 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |