Forum Discussion
New measure
- 8 years ago
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
When I have the table only like this:
And I would like to calculate the percentage: OK / Total.
Make and adaptation of the previous formula:
percentage =
IF (
DISTINCTCOUNT ( 'Status'[NOK/OK] ) > 1 ,
1 ,
IF (
DIVIDE (
CALCULATE (
SUM ( 'Status'[Amount in EUR] ),
'Status'[NOK/OK] = VALUES ( 'Status'[NOK/OK] )
),
CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[NOK/OK] ) )
)
= BLANK (),
0 ,
DIVIDE (
CALCULATE (
SUM ( 'Status'[Amount in EUR] ),
'Status'[NOK/OK] = VALUES ( 'Status'[NOK/OK] )
),
CALCULATE ( SUM ( 'Status'[Amount in EUR] ), ALL ( 'Status'[NOK/OK] ) )
)
)
)
Regards,
MFelix
- KellyLen8 years ago
Helper III
MFelix Thank you, the previous formula worked perfectly as usually. :)
I have query with following columns:
And have created tabels like these:
I would like to create measure, which would calculate the percentage 1st pass matching / Matching success.
Are you able to help me.. again? :)
Best regards,
Kelly
- KellyLen8 years ago
Helper III
Hi MFelix,
I have there values: Count of 1st pass match. Rows are Order origin. and columns are Date.
I would like to calculate % based on Matching success values. For example based on my previous screenshots I would like to calculate Fuel TBO % - 4/68 = 0,0588 .. and like this for each row.
- MFelix8 years ago
Super User
How do you get the information that it doesn't ave PO?
- KellyLen8 years ago
Helper III
I have in order origin four values No PO, PO, Crew hotel TBO and Fuel TBO. I would like to exclude the No PO values.
- KellyLen8 years ago
Helper III
Just filtering works as well. :) Thank you for helping me again. :)