Forum Discussion

king4646's avatar
king4646
Frequent Visitor
3 years ago
Solved

Percentilex.inc/exc issue

Hi Guys, I'm having an absolutely huge headache from a measure one of the guys here created for my excel.     It seems to work absolutely fine when I am looking at industry level it scores 1-6 app...
  • v-yueyunzh-msft's avatar
    v-yueyunzh-msft
    3 years ago

    Hi , king4646 

    Thanks for your quick response !

    Sorry for i have no excel developer experience and for your issue is "when I use my slicer, I filter by a field called EXCLUDED CUSTOMER Y_N. I select the "no" to only bring in customers that are not excluded and at that point the percentiles calculated seem to break."
    I'm testing this here and I'm sorry, this really doesn't support Joan Slicer. Maybe it's a matter of context!

    And for this , can you try to use this dax code to test , i modify the ALLSELECTED() function.You can try to check if this can meet your need:(This is put for the Customer table visual)

    20th percentile-2 = var _20= PERCENTILEX.INC(ADDCOLUMNS(CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer]))  ,"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.2)
    Return
    _20

     

    80th percentile-2 = var _80= PERCENTILEX.INC(ADDCOLUMNS(CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])),"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.8)
    Return
    _80

     

    Dynamic Cust Pts = var _20= PERCENTILEX.INC(ADDCOLUMNS(CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])),"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.2)
    var _40 = PERCENTILEX.INC(ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])) ,"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.4)
    var _60 = PERCENTILEX.INC(ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])),"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.6)
    var _80 = PERCENTILEX.INC(ADDCOLUMNS(CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])) ,"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.8)
    var _90 = PERCENTILEX.INC(ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])) ,"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 0.9)
    var _100 = PERCENTILEX.INC(ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Published','Published'[Customer_Media_Type],'Published'[Customer]) ,ALL(Published[Customer_Media_Type],'Published'[Customer])) ,"Sum of Revenue" , CALCULATE(SUM(Published[Revenue]))) , [Sum of Revenue] , 1)
    var _revenue = SUM(Published[Revenue])
    return
    IF( _revenue < _20 ,1, IF(_revenue >= _20 &&_revenue<_40 ,2 ,IF( _revenue >=_40 && _revenue<_60 ,3, IF(_revenue>=_60 && _revenue < _80 , 4 , IF(_revenue>=_80 && _revenue < _90 ,5 , 6)))))

     

    The result is as follows:

     

     

    we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly