Forum Discussion

nicoenz's avatar
nicoenz
Icon for Helper III rankHelper III
2 years ago
Solved

Percentile 33 based on a summarized table

Hi everyone,  I have a table with production data by product, region and many other columns Table 1               Product Customer Region other columns in table Production     ...
  • OwenAuger's avatar
    2 years ago

    Hi nicoenz 

    Use PERCENTILEX.INC like this:

    Production Percentile 33 by Product = 
    PERCENTILEX.INC (
        VALUES ( Production[Product] ),
        CALCULATE ( SUM ( Production[Production] ) ),
        0.33
    )

     

    Also, if you create a measure for Production Sum (which I would recommend) e.g.

    Production Sum =
    SUM ( Production[Production] )

    then you can write:

     

    Production Percentile 33 by Product = 
    PERCENTILEX.INC (
        VALUES ( Production[Product] ),
        [Production Sum],
        0.33
    )

     

    Does this work for you?

     

    Regards

  • OwenAuger's avatar
    OwenAuger
    2 years ago

    Hi again nicoenz 

    Apologies, I was caught up yesterday.

     

    You could reformulate slightly and create a measure like this:

    Production below 33rd Percentile = 
    VAR Percentile33 =
        CALCULATE (
            PERCENTILEX.INC ( VALUES ( Production[Product] ), [Production Sum], 0.33 ),
            ALLSELECTED ()
        )
    VAR ProductionBelowPercentile33 =
        SUMX (
            VALUES ( Production[Product] ),
            VAR Prod = [Production Sum]
            RETURN
                IF ( Prod < Percentile33, Prod )
            )
    RETURN
        ProductionBelowPercentile33

    Does this work for you?

     

    Regards