Forum Discussion
Percentage mix for multiple dimensions
- Anonymous5 years ago
Hi amaddala ,
According to my understanding, you want to calculate the % of each type(NAK,Failure, Success) under each category(2021-w22,2021-w23...), right?
You could use the following formula to create measures:
Sum Measure = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Cate] = MAX ( 'Table'[Cate] ) ) )nak Measure = DIVIDE ( CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Type] = "NAK" && 'Table'[Cate] = MAX ( 'Table'[Cate] ) ) ), [Sum Measure], 0 )Failure Measure = DIVIDE ( CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Type] = "Failure" && 'Table'[Cate] = MAX ( 'Table'[Cate] ) ) ), [Sum Measure], 0 )Success Measure = DIVIDE ( CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Type] = "Success" && 'Table'[Cate] = MAX ( 'Table'[Cate] ) ) ), [Sum Measure], 0 )The final output is shown below:
Please take a look at the pbix file here.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi amaddala ,
According to my understanding, you want to calculate the % of each type(NAK,Failure, Success) under each category(2021-w22,2021-w23...), right?
You could use the following formula to create measures:
Sum Measure =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Cate] = MAX ( 'Table'[Cate] ) )
)nak Measure =
DIVIDE (
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Type] = "NAK"
&& 'Table'[Cate] = MAX ( 'Table'[Cate] )
)
),
[Sum Measure],
0
)
Failure Measure =
DIVIDE (
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Type] = "Failure"
&& 'Table'[Cate] = MAX ( 'Table'[Cate] )
)
),
[Sum Measure],
0
)
Success Measure =
DIVIDE (
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Type] = "Success"
&& 'Table'[Cate] = MAX ( 'Table'[Cate] )
)
),
[Sum Measure],
0
)The final output is shown below:
Please take a look at the pbix file here.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.