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
Anonymous
Not applicable

Top 10 Rank based on user filter selection

Hi Everyone,

 

This is my first post here, so please excuse me if i happen to violate any of the communities's etiquettes.

 

So i am working with the below dataset:

 

Ad NameAd RevenueCPRRER
X20050023
Y3223244
Z339443

442

 

Now, i want to display the top 10 Names based on a filter. The filter will contain the above three columns : Ad Revenue, CPRP, & ER.

 

Basically, the top 10 ad names will be displayed based on whataver filter selection i am chosing. PLease note the i have these as seperate columns in my current data.

 

Need urgent help with this. I am stuck to figure out on how to handle the dynamic user input and calcuate rank/top10 based on that.

 

Thanks,

Aman

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

The following is my sample for display top 10 based on Ad Revenue. You can reference to modify your report.

 

I have two tables. One is the sample you post. Another just contained one column of the column name from Table1. It will be used to a slicer.

1.jpg2.jpg3.png

  1. Creat a measure
Measure 2 =
VAR se =  SELECTEDVALUE ( 'Table2'[Column1])
RETURN
 SWITCH( TRUE(),
 se = "Ad Revenue",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[Ad Revenue],SELECTEDVALUE('Table1'[Ad Revenue]),DESC,'Table1'[Ad Name],SELECTEDVALUE('Table1'[Ad Name]),DESC))),
 se = "CPRR",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[CPRR],SELECTEDVALUE('Table1'[CPRR]),DESC,'Table1'[CPRR],SELECTEDVALUE('Table1'[CPRR]),DESC))),
se = "ER",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[ER],SELECTEDVALUE('Table1'[ER]),DESC,'Table1'[ER],SELECTEDVALUE('Table1'[ER]),DESC))),
BLANK()
)
  1. Drag the measure to Visual level filters.

Filter type -- > change to Top N -- > show items : Top 10 -- > drag Rank to By value -- > Apply filter

4.jpg5.jpg

Best Regards,

Xue Ding

 

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

Best Regards,
Xue Ding
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

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

The following is my sample for display top 10 based on Ad Revenue. You can reference to modify your report.

 

I have two tables. One is the sample you post. Another just contained one column of the column name from Table1. It will be used to a slicer.

1.jpg2.jpg3.png

  1. Creat a measure
Measure 2 =
VAR se =  SELECTEDVALUE ( 'Table2'[Column1])
RETURN
 SWITCH( TRUE(),
 se = "Ad Revenue",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[Ad Revenue],SELECTEDVALUE('Table1'[Ad Revenue]),DESC,'Table1'[Ad Name],SELECTEDVALUE('Table1'[Ad Name]),DESC))),
 se = "CPRR",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[CPRR],SELECTEDVALUE('Table1'[CPRR]),DESC,'Table1'[CPRR],SELECTEDVALUE('Table1'[CPRR]),DESC))),
se = "ER",
COUNTROWS(FILTER(ALL('Table1'),ISONORAFTER('Table1'[ER],SELECTEDVALUE('Table1'[ER]),DESC,'Table1'[ER],SELECTEDVALUE('Table1'[ER]),DESC))),
BLANK()
)
  1. Drag the measure to Visual level filters.

Filter type -- > change to Top N -- > show items : Top 10 -- > drag Rank to By value -- > Apply filter

4.jpg5.jpg

Best Regards,

Xue Ding

 

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

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

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.