Forum Discussion

powertechbi's avatar
powertechbi
Frequent Visitor
1 year ago
Solved

Help With High and Lower Ranks

Good afternoon I'm putting together a dashboard and I'm stuck on a question. I need to create a graph that shows the largest / smallest values ​​depending on the quantity selected. In other words, ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi powertechbi 

     

    The lowest value is shown as null because there are some null values in your data, and your Measure recognizes null values as the minimum values.

    When I debug your measure, it returns something like this:

    What you need to do is to filter the measure as not blank, please try this measure:

     

    TopN =
    VAR Tops =
        SELECTEDVALUE ( 'Rank Bairro'[Rank Bairro] )
    VAR Maior =
        SELECTEDVALUE ( Ordem[ordem] ) = "Maiores"
    VAR Menor =
        SELECTEDVALUE ( Ordem[ordem] ) = "Menores"
    VAR TopMaior =
        CALCULATE (
            [Medidas Dinamicas Venda],
            KEEPFILTERS (
                TOPN ( Tops, ALL ( Imoveis[Bairro] ), [Medidas Dinamicas Venda], DESC )
            )
        )
    VAR TopMenor =
        CALCULATE (
            [Medidas Dinamicas Venda],
            KEEPFILTERS (
                TOPN (
                    Tops,
                    FILTER ( ALL ( Imoveis[Bairro] ), [Medidas Dinamicas Venda] <> BLANK () ),
                    [Medidas Dinamicas Venda], ASC
                )
            )
        )
    RETURN
        SWITCH ( TRUE (), Maior, TopMaior, Menor, TopMenor, [Medidas Dinamicas Venda] )
    

     

    The result is as follow:

     

    Best Regards

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