Forum Discussion
Help With High and Lower Ranks
- Anonymous1 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.
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.
Thank you so much!
Working Perfect Now !