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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
procyon82
Resolver I
Resolver I

Rankx with filter

I am pulling event data from Google Analytics and currently have a column that has all kinds of different files (pdf, docx, xlsx) and an other column with the associated number of downloads. So, for example, I know how many times a certain file was downloaded.

 

How can I rank file types within their own file types? In other words, how can I show the top 10 pdf files, top 10 docx files, etc. without using filters at the query level?

I've only managed to show the overall rank.

1 ACCEPTED SOLUTION
PowerBIGuy
Responsive Resident
Responsive Resident

You can try implementing the following. 

 

 

Example:
Total Downloads= SUM(table[Downloads Fact])
Downloads Rank by FileType = RANKX(ALLSELECTED(table[FileType]), [Total Downloads])
Total Downloads Top 10 by FileType = IF([Downloads Rank by FileType] <= 10, [Total Downloads])

Business Intelligence Architect / Consultant

View solution in original post

1 REPLY 1
PowerBIGuy
Responsive Resident
Responsive Resident

You can try implementing the following. 

 

 

Example:
Total Downloads= SUM(table[Downloads Fact])
Downloads Rank by FileType = RANKX(ALLSELECTED(table[FileType]), [Total Downloads])
Total Downloads Top 10 by FileType = IF([Downloads Rank by FileType] <= 10, [Total Downloads])

Business Intelligence Architect / Consultant

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors