cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
H_insight
Helper III
Helper III

TopN by Report Name

Hi all, 

 

I am trying to get a simple TopN by report names. The N is a range from 1~5. Based on the frequency of the report name (i.e. count) I would like to show top N by report name.

 

attached sample file and a screenshot of the expected outcome.

 

HeshamK_0-1632400022891.png

 

Sample file.

 

Thanks.

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @H_insight ,

 

You can also try the following formula, refer to the following test:

 

Col_count =
CALCULATE ( COUNTROWS ( Data ), ALLEXCEPT ( Data, Data[Report Name] ) )
Column = 
RANKX (
    Data,
    CALCULATE ( COUNTROWS ( Data ), ALLEXCEPT ( Data, Data[Report Name] ) ),
    [Col_count],
    ,
    DENSE
)

 

Put the measure formula in the filter of the table visual and set the value to not 0:

vhenrykmstf_0-1632735529469.png

vhenrykmstf_1-1632735551349.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @H_insight ,

 

You can also try the following formula, refer to the following test:

 

Col_count =
CALCULATE ( COUNTROWS ( Data ), ALLEXCEPT ( Data, Data[Report Name] ) )
Column = 
RANKX (
    Data,
    CALCULATE ( COUNTROWS ( Data ), ALLEXCEPT ( Data, Data[Report Name] ) ),
    [Col_count],
    ,
    DENSE
)

 

Put the measure formula in the filter of the table visual and set the value to not 0:

vhenrykmstf_0-1632735529469.png

vhenrykmstf_1-1632735551349.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Thanks @v-henryk-mstf. for sharing the solution. This is exactly what I was looking for.

amitchandak
Super User
Super User

@H_insight , measures like

 

report count = count(Table[report Name])

calculate(AverageX(Table,[report count ]),TOPN(5,allselected(Date[report Name]),[report count ],DESC), values(Date[report Name]))

 

 

refer if neeed

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

 

in place five you can use what if , if needed

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!