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.
Hi,
I need to create a DAX measure that calculates the Picking % only for the columns with Comment Good.
Picking % = 1 - ( Difference between Initial and Control / Control )
I have this example table:
Initial | Prep | Control | Comment | Diff Initial & Control | Picking % | |
0 | 0 | 8 | Error? | 8 | 0% | |
3 | 0 | 0 | Manquant | 3 | #DIV/0! | |
0 | 0 | 2563 | Error | 2563 | 0% | |
2 | 2 | 0 | Error? | 2 | #DIV/0! | |
1 | 1 | 1 | Good | 0 | 100% | |
2 | 2 | 2 | Good | 0 | 100% | |
5 | 5 | 2 | Good | 3 | -0,5 | |
TOTAL | 8 | 8 | 5 | 3 | 40% |
What DAX measure should I write?
Thank you
Julie
HI @jewel_at ,
when I add your measure in a table I get correct row values.
But the total value is left blank or takes the sum.
When I select some rows in my table (only the 'Good' ones) then the measure takes the sum of the Picking Accuracy (100% + 100% + 100% = 300%). Which is not the correct total (100% + 100% + 100% = should be 100%).
You know how to get the total value?
Hi @JulieB_
I updated my original response. The reason the total was left blank when there are other not "Good" comments is because, I assigned "" instead of 0.
Are you looking for the average instead of Total Sum? You can use AVERAGEX instead 🙂
Hi @JulieB_
Have you tried:
Picking % =
var Comment = SELECTEDVALUE('Table'[Comments])
return IF (Comment = "Good", SUMX('Table', 1 - ('Table'[Diff Initial] - 'Table'[Control]/'Table'[Control])),0)
Hope that helps!
Jewel
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 |
---|---|
41 | |
19 | |
19 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |