Forum Discussion

MTrullàs's avatar
MTrullàs
Icon for Helper III rankHelper III
4 years ago
Solved

Percentil with filter

Hello world!   Yesterday, with the help of AlB I was able to solve a problem with the task Percentile Today I have a new challenge with the same topic. I have to calculte the same measure with the...
  • AlB's avatar
    4 years ago

    Hi MTrullàs 

    It's the ALL(Tabla) that is overriding all the filters. Try this. If it doesn´t work, share the data in the same format as you did yesterday. Today's format is not good to copy

     

    NewMeasure_2 = 
    VAR total_ = CALCULATE ( COUNT ( Tabla[Estancia Fábrica] ), ALL ( Tabla[Estancia Fábrica]) )
    VAR currentEst_ = SELECTEDVALUE ( Tabla[Estancia Fábrica], total_ )
    VAR cumul_ =
        CALCULATE (
            COUNT ( Tabla[Estancia Fábrica] ),
            Tabla[Estancia Fábrica] <= currentEst_,
            ALL ( Tabla[Estancia Fábrica] )
        )
    RETURN
    DIVIDE ( cumul_, total_ )

     

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.