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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Sofinobi
Helper IV
Helper IV

Best practice for grouping data performance

hello all,

please i'm looking for advices about the best practices to group data
so, i have a sales table with more than 6 millions rows, that store all the sales operations by (date time, seller, costomer, product, product category , ....)
- in my report i'll need only the date (not  the time), the product and the product category
my question is : if i group the data by these 3 columns, the report will be more performant?
if yes, it's best to groupe in SQL server, write sql query in power bi (when getting data), grouping data in power query or grouping data with DAX?

thank you  for your advices 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Sofinobi ,

 

Grouping/aggregating data to just Date, Product, and Product Category before sending it to your data model should give you significant performance improvements over just using the data in its stored granularity.

In terms of how/where to do this I would recommend doing it as far away from your data model as possible, i.e. in order of preference:

 

-1- Have a new table added to your SQL DB with this aggregated data, or;

-2- Write an SQL view that outputs this aggregated data, or;

-3- Do it in Power Query while maintaining query folding

 

For maximum efficiency, you should also only include Product Code/ID and Product Category Code/ID in this table. The text descriptions should be held in dimension tables that you then use to build a star schema model with.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Sofinobi ,

 

Grouping/aggregating data to just Date, Product, and Product Category before sending it to your data model should give you significant performance improvements over just using the data in its stored granularity.

In terms of how/where to do this I would recommend doing it as far away from your data model as possible, i.e. in order of preference:

 

-1- Have a new table added to your SQL DB with this aggregated data, or;

-2- Write an SQL view that outputs this aggregated data, or;

-3- Do it in Power Query while maintaining query folding

 

For maximum efficiency, you should also only include Product Code/ID and Product Category Code/ID in this table. The text descriptions should be held in dimension tables that you then use to build a star schema model with.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




@BA_Pete  thank you so much for your answer, thats help me alot

thanks again

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.