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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Top and Bottom 5

Hi Everyone, 

 

I know its a very simple query but I don;t know why I am not gettting the correct results through filter.

 

Top5 Conditions

 

I have student ID along with distance travelled in a race. I want to filter the students who have covered more than 100m in race also want the top5 studeny by distance cover (higher the distance would be first) along with I have given a rating so for Top category rating should also be 5. So two conditions here for Top 5 - Distance is more than 100m, Rating would be 5.

 

Bottom 5 Condition

 

Rating would be 1 and distance covered would be more than 100m again. (I dont want to consider 0 in bottom rating)

 

Below is sample data

 

Student NumberDistance TravelledRating
9624571025
943307784
10024511602
12786531830
18892081623
19538001230
2139973515
846809320
9613601634
18554461515
7628471784
11486251231
20075061710
17539211780
2182136544
2018665550
19184561813
1312026533
5133571805
7825071075
2537671394
1486661972
1355566550
4153421442
681480904
1758550685
2174231413
15512681593
824355795
1281391815

 

I used a matrix where I have student name in first column, distance covered in second column, rating in third column. I filtered Rating as 5, Distance is greater than 100 but when I am filtering Top5 by distance it is showing blank.

 

Refer below snapshot

Capture4.PNGCapture3.PNGCapture 2.PNGCapture 1.PNG

 

Kindly help.

 

Regards

Uphar

 

2 REPLIES 2
Anonymous
Not applicable

Hi,

 

I am able to produce the results by using the filter with Calculate

 

Top 5 = CALCULATE(SUM(table[Distance]),FILTER(Table,table[Star Rating]=5)) and then used filter for more than 100km
 
Thanks for your help.
 
Regards
Uphar
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

I am not able to reproduce your result with the sample data you have provided:
image.png

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Kudoed Authors