Forum Discussion

yforti13's avatar
yforti13
Regular Visitor
1 year ago
Solved

Help topn function

Good afternoon!

I am having a problem with the display of my topn formula.


In the first photo the measurement being used is this:

top10 =
CALCULATE(
    [m_CNE180],
    FILTER(
        VALUES(d_DemaisConvenios[Convênio]),
        [m_TopCNE180Gruposaaa] <=10))

Result:


In the second photo the measurement being used is this:

m_Top10v2 =

var x =CALCULATE(
    [m_CNE180],
    FILTER(
        VALUES(d_DemaisConvenios[Convênio]),
        [m_TopCNE180Gruposaaa] <=10
        && NOT(ISBLANK([m_CNE180]))))

RETURN
SWITCH(
    TRUE(),
    NOT ISINSCOPE( d_DemaisConvenios[Convênio] ) && NOT ISINSCOPE( d_Grupos[Value] ),
    [m_CNE180],

    NOT ISINSCOPE( d_DemaisConvenios[Convênio] ) && SELECTEDVALUE( d_Grupos[Value] ) = "3. Demais Convênios",
    [m_CNE180],

    SELECTEDVALUE( d_Grupos[Value] ) = "1. Top 10",
    x

Result:

For some reason that I don't know, in the second formula it shows me this line marked in yellow, which had no data for the current month (February)

Does anyone know how to solve this? If there was no data for the current month, it shouldn't show the information


 





 

  • You have multiple dates. The TOP10 will be different for each date, and that is not something you can show in a table visual like that.  If you calculate the Top 10 across all selected dates then your result is likely correct.

4 Replies

  • You have multiple dates. The TOP10 will be different for each date, and that is not something you can show in a table visual like that.  If you calculate the Top 10 across all selected dates then your result is likely correct.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi yforti13 ,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
    If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Regards,
    Chaithra.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi yforti13 ,

    We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
    If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Regards,
    Chaithra.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi yforti13 ,

    We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
    If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Regards,
    Chaithra.