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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sabeer93
Frequent Visitor

Summarize table with 10 records for each category

Summarize table with 10 records for each category without having the arthematic expressions columns. 

The  records from the single table having 1Lac rows and its should display 10 records for each category in the table visual. 
Please can someone help with the DAX logic to implement 

@dax

 

5 REPLIES 5
WinterMist
Impactful Individual
Impactful Individual

@Sabeer93 

 

My apologies. 

Can't take credit for this.

Thought I knew how to do this, but had to learn from @v-yueyunzh-msft .

 

Step 1) Create a calculated column which provides a truly unique ID.  Part of the problem is that your table currently has no unique ID, and therefore, no way to break ties to get an exact number of records (e.g. 5) for each group (e.g. City).  You can create the unique ID any way you like, but this is what I did.

 

WinterMist_0-1691446176377.png

 

Step 2) Create a measure that ranks the Unique ID from 1 to N, separately for each group (in this case, for each City group).

 

WinterMist_1-1691446261461.png

 

 

Step 3) Filter the table visual by the newly created measure & specify where:

[Rank Unique ID for each City] is less than 6.

 

WinterMist_2-1691446366113.png

 

The table visual now returns only 5 records for each City.

 

WinterMist_3-1691446442658.png

 

 

Does this solution work for you?

 

Or does it need to be truly random?  (meaning, do the records returned need to change every time the report is generated?)

 

Regards,

Nathan

Sabeer93
Frequent Visitor

https://drive.google.com/file/d/11wUFZyZCYaTHMVLRceXALSQqrxOyPCTu/view?usp=sharing

Attached is the sample mock data and trying to get the solution 

Need to Summarize the data in table visual for each city with only 5 random records data. 

Sabeer93
Frequent Visitor
Take3
Regular Visitor

@Sabeer93 

 

I'm not following you very well.

Would it be possible to provide a sample screenshot of the data you are starting with, as well as a screenshot of the desired result (e.g. Excel mock-up)?

 

1) Do you mean that the table you want to summarize already has 10 records for each category?  Or are you saying that it has more, but you want the result to summarize the top 10 records for each category?

 

2) What do you mean "without having the arithmetic expressions columns"?

 

3) What do you mean "records from the single table having 1Lac rows..."?

   - What do you mean by "single table"?

   - What do you mean by "having 1Lac rows"?  What does 1Lac mean?

 

Regards,

Nathan

@Take3 any help ?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.