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
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
Hi,
Actually, I would need the total calculation be based on statuses totals as well.
The hole visual looks actually like this:
I do not know, if the subcategory there changes anything. I did not noticed to add this at first. :/
- MFelix8 years ago
Super User
I just made a change ot my answer please check it.