Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Percentile calculation not working properly with filter

Hey everyone,

 

I have created some calculated columns to get 50th, 60th, 70th percentile of a column in a table.

 

Cal_P50 = PERCENTILE.INC('Table'[percentile_column_name],.50)
Cal_P60 = PERCENTILE.INC('Table'[percentile_column_name],.50)
Cal_P70 = PERCENTILE.INC('Table'[percentile_column_name],.50)
 
This does not work properly when it needs to be used with a slicer on another column present in the table. That is, any selection on the slicer does NOT change the values of Cal_P50, Calc_P60 and Calc_P70.
 
I created a calculated table that would get filtered on the slicer selection, and tried using the same method, but that does not work as well.
 
Is there a way to pass filtered column values as first parameter of percentile function? I tried usind SELECTCOLUMNS, but doesn't help me.
 

 

Any help would be highly appreciated.

 

Regards,

Ayushi Agrawal

  • Anonymous's avatar
    Anonymous
    4 years ago

    Anonymous 

    You have to refer to a column to get the percentile. If you your model has correct relationship settled, you can just use the column(a list of filtered value) as the slicer, the percentile measures should filtered automatically. 

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous , What does selectcolumns doing there. It returns table.

    Selectcolumn inside table , something is not correct

    • Anonymous's avatar
      Anonymous
      Not applicable

      yes, right. I was assuming that SELECTCOLUMNS would return the column, and then it can pe passed to PERCENTILE function.

       

      is there any way I can pass FILTERED column to PERCENTILE function..(a list of filtered value which would contain only rows corresponding to slicer selection)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    You have to refer to a column to get the percentile. If you your model has correct relationship settled, you can just use the column(a list of filtered value) as the slicer, the percentile measures should filtered automatically. 

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.
  • If anyone has the same problem adding the percentile to a plot with filters. I solved it using this:

    Percentil25 =
    PERCENTILEX.INC(
    FILTER(
    Ventas,
    NOT ISBLANK(Ventas[Valor]) -- Avoids error of null values
    ),
    Ventas[Valor],
    0.25
    )