Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Pareto Chart

Hi all,

 

I am working on a pareto chart but am facing an error whereby cumulative summing doesn't work when there are categories with the same count as seen below

  Cat A w/ sub-categories with same count                                   Cat B w/ sub-categories of unique counts

Below is the code used for the line measure

 

Pareto Measure = 
VAR TotalCount = CALCULATE(
        DISTINCTCOUNT('Aircraft Records'[Investigation  Report No. (INV)]),
        FILTER(
            ALLSELECTED('Aircraft Records'),
            'Aircraft Records'[Investigation  Report No. (INV)] <> BLANK()
        )
    )

VAR currentCount = 
    CALCULATE(
        DISTINCTCOUNT('Aircraft Records'[Investigation  Report No. (INV)]),
        FILTER(
            'Aircraft Records',
            'Aircraft Records'[Investigation  Report No. (INV)]<> BLANK()
        )
    )


VAR summarisedtable =
    SUMMARIZE(
        FILTER(
            ALLSELECTED('Aircraft Records'),
            'Aircraft Records'[Investigation  Report No. (INV)] <> BLANK()
        ),
        'Aircraft Records'[Sub-Root Cause],
        "CountInv",
        DISTINCTCOUNT('Aircraft Records'[Investigation  Report No. (INV)])
    )

VAR cumulative = sumx(filter(summarisedtable, [CountInv] >= currentCount),[CountInv])

return cumulative/TotalCount

 

 

Any help would be very much appreciated!!

2 Replies