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.
I need assistance with the following formula to get the following:
The value of two columns multiplied by each other ( [litre] * [concentration] ) and the results of that equation multipled by 15.99. I only want to perform that calculation on the rows in a table where [result]="Fail".
I've tried the below, formula, but cannot get it to work.
CALCULATE(table[Fail],(table[Litre]*table[concentration])*15.99)
Thanks, in advance!
Solved! Go to Solution.
To use a measure try using SUMX
Measure = CALCULATE(SUMX('Table';'Table'[Litre]*'Table'[Concentration]*15,99); FILTER('Table';'Table'[result]="Fail"))
in the expr of SUMX(table, expr), you can put any mathematic logic you need.
in the same formula change the SUMX expression to
SUMX('Table';'Table'[Litre]-('Table'[Litre] * 'Table'[Concentration]*15,99))
hope this helps 🙂
To use a measure try using SUMX
Measure = CALCULATE(SUMX('Table';'Table'[Litre]*'Table'[Concentration]*15,99); FILTER('Table';'Table'[result]="Fail"))
I have a further refinement that I could use your expertise with. I've used the formula you provided:
Magna Losses = CALCULATE(SUMX('table',table[Litre]*table[Concentration]*15.99), FILTER('table',table[result]="Fail"), FILTER('table',table[Fuel Type]="Magna"))
But the final results that I am trying to get are presented here in a using mathematic logic (I still need to filter in the formula above):
(table[Litre] - (table[Litre] * table[Concentration])*15.99)
How would I translate that into a DAX statement?
Thanks, in advance!
in the expr of SUMX(table, expr), you can put any mathematic logic you need.
in the same formula change the SUMX expression to
SUMX('Table';'Table'[Litre]-('Table'[Litre] * 'Table'[Concentration]*15,99))
hope this helps 🙂
Try this:
Measure = CALCULATE(SUM((table[Litre]*table[concentration])*15.99),table[result]="Fail",)
The issue here is that if this is a measure, you need to do some kind of aggregation. Another way to do this would be to create a calculated column like this:
Column = IF(table[result]="Fail",table[Litre]*table[concentration]*15.99,0)
Returns your caculation if the result is "Fail" or else returns 0.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |