Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
yforti13
Regular Visitor

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:
yforti13_1-1744230302911.png


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:

yforti13_3-1744230417350.png

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


 





 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

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.

View solution in original post

4 REPLIES 4
v-echaithra
Community Support
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
Community Support
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
Community Support
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.

lbendlin
Super User
Super User

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.