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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.