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
ch4rch
Frequent Visitor

TOP N not working and driving me crazy

Hi First post so please excuse any stupidity.

 

I am in the process of migrating a dataset from being powered by excel exports to the same data in SQL so that I don't have to manually refresh that data every month.

 

The Data is a list of Call Center interactions and in Excel I assigned a RAND column which was then used to filter to show Top 3 agent interactions based on that random number. it worked perfectly.

 

No In SQL I found that RAND created the same ID for every row. So I created two columns NEWID() AS Random_ID and CRYPT_GEN_RANDOM(2) % 900000000 AS 'Index',

 

If I use either of these with TOP N I always get zero results. My Table visualisation will show all of the interactions for an agent in a chosen month perfectly but as soon as I filter by TOP N of either the Index or Random_ID I get nothing.

 

Anyone got any thoughts?

 

 

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @ch4rch 

 

you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Thanks, I have seen your videos however I don't understand why I would need to create measures when each row already has a unique ID in the table.

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.