Forum Discussion

Thigs's avatar
Thigs
Icon for Helper IV rankHelper IV
4 years ago
Solved

Pareto without Bars?

Hi all I'm trying to make a Pareto chart but I'm having an issue. Basically, it works, but my x-axis (skus) is huge (several thousand). So what I want is to make the x-axis % of skus, but obviously,...
  • AlexisOlson's avatar
    AlexisOlson
    4 years ago

    It is indeed relatively complex, so I will provide an actual working example.

     

    I downloaded the .pbix from this article and created a new Axis table and a new measure:

    Bucket Sales = 
    VAR BucketMin = SELECTEDVALUE ( 'Axis'[Value] )
    VAR BucketMax = CALCULATE ( MIN ( 'Axis'[Value] ), 'Axis'[Value] > BucketMin )
    VAR NonZeroProducts = FILTER ( VALUES ( Products[ProductKey] ), [Total Sales] > 0 )
    VAR NonZeroCount = COUNTROWS ( NonZeroProducts )
    VAR Summary =
        ADDCOLUMNS (
            NonZeroProducts,
            "@Rank%", DIVIDE ( RANKX ( NonZeroProducts, [Total Sales] ), NonZeroCount )
        )
    VAR BucketSum =
        SUMX (
            FILTER ( Summary, [@Rank%] >= BucketMin && [@Rank%] < BucketMax ),
            [Total Sales]
        )
    RETURN
        DIVIDE ( BucketSum, NonZeroCount )

    The result looks like this:

     

    See the attached modified file.