Forum Discussion

ce2016's avatar
ce2016
Frequent Visitor
8 years ago
Solved

Pareto Chart with multiple aggregation levels

Dear all,   I am trying to create a pareto chart that allows me to visualize the amount of deliveries categorized by different codes, whereas I am able to switch on slicer filter from year, to mont...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    8 years ago

    Hi ce2016,

    After check in details, I get expected results eventually. The "MAXX('Sample',[RankingSample])" in your formula is wrong, you can create another measure to test, I create another measure named "Test max of RankingSample", it should returen the max value utill current rows, while it returns wrong result, so please correct using VAR in DAX, like [current max Measure] measure, then you can use it in your cumulative total measure.

    Test max of RankingSample = MAXX('Sample',[RankingSample])
    current max Measure = VAR rr=[RankingSample]
    RETURN(rr)


    Then change your formula as follows,

    New Cumulative TotalSample = VAR rr=[RankingSample]
    RETURN( CALCULATE(
    	SUM('Sample'[Amount of Deliveries]),
    	FILTER(ALLSELECTED('Sample'),
    		[RankingSample]<= rr
    	)))
    
    Cumulated Percentage = [New Cumulative TotalSample]/[Total per DC]


    Now when you can get expected result whether the filter is set on month or week.

    filter on monthfilter on week

    Please download the attachment to check more details.

    Best Regards,
    Angelia