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,
How should the DAX look like if I would like to create measure with following information:
Used columns are:
And values are Amount in EUR.
I would like to calculate the percentage, where the formula is like Status: 1. Execution / Overall Total. For example 28 250 083,14 / 36 057 104,09 = ...
Could you please help me with this?
Best regards,
Kelly
Solved! Go to Solution.
Hi @KellyLen,
Based on your table try to use this measure:
percentage = IF ( DISTINCTCOUNT ( 'Status'[Status] ) > 1 , 1 , IF ( DIVIDE ( CALCULATE ( SUM ( 'Status'[Amount in EUR] ), 'Status'[Status] = VALUES ( 'Status'[Status] ) ), CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[Status],'Status'[NOK/OK] ) ) ) = BLANK (), 0 , DIVIDE ( CALCULATE ( SUM ( 'Status'[Amount in EUR] ), 'Status'[Status] = VALUES ( 'Status'[Status] ) ), CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[Status],'Status'[NOK/OK] ) ) ) ) )
Then format as % and you should get the result below (put it as table to be more visible).
If you need to take out only the Ok status and remove the NOK from the calculation
percentage = IF ( MAX ( 'Status'[NOK/OK] ) = "NOK", BLANK (), IF ( DISTINCTCOUNT ( 'Status'[Status] ) > 1, 1, IF ( DIVIDE ( CALCULATE ( SUM ( 'Status'[Amount in EUR] ), 'Status'[Status] = VALUES ( 'Status'[Status] ) ), CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[Status] ) ) ) = BLANK (), 0, DIVIDE ( CALCULATE ( SUM ( 'Status'[Amount in EUR] ), 'Status'[Status] = VALUES ( 'Status'[Status] ) ), CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[Status] ) ) ) ) ) )
Total calculations can also be redone to not include NOK
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |