Forum Discussion

Wael03's avatar
Wael03
Helper I
3 years ago

Percentages in matrix

Hello, 

 

I try to display the percentages of each sub category in a matrix using this code : 

3DS Ratio =
IF (
    ISFILTERED (Table1[3DS Merchant Name (Raw)*]),
    SUM (Table1[3DS AReq Count (Issuer)])
    /
    CALCULATE (
        SUM (Table1[3DS AReq Count (Issuer)]),
        ALL (Table1[3DS Merchant Name (Raw)*])
    ),
    IF (
        ISFILTERED (Table1[3DS ARes Category]),
        SUM (Table1[3DS AReq Count (Issuer)])
        /
        CALCULATE (
            SUM (Table1[3DS AReq Count (Issuer)]),
            ALL (Table1[3DS ARes Category])
        ),
        IF (
            ISFILTERED (Table1[3DS Requester Challenge Indicator]),
            SUM (Table1[3DS AReq Count (Issuer)])
            /
            CALCULATE (
                SUM (Table1[3DS AReq Count (Issuer)]),
                ALL (Table1[3DS Requester Challenge Indicator])
            )
        )
    )
)
 
Here is what I get :
 

 

As you can see it works for the first category but then for the second one I got 5.84 and 8.7 in the first rows while I wanted something that makes 100% in total so for example 70% and 30%.

 

How can I modify the code to get that ?