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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
WCONGRAVE
Advocate I
Advocate I

Group Orders by Quantity of Item ordered

HI

 

I have a Star Schema Model, with all of the data held in the fact table linked to dimension tables such as customer, calendar, product etc.

 

Now I have a requirement to report based upon how many items are in an order as per below

 

Items in OrderCount of OrdersTotal £
11000£10000
212000£260000
314000£450000
415000£666000
513000£845000

 

In my mind, to do this I'd need a Sales Header table with the count of lines in it per order to act as a DIM table. I could then join on the transaction ID and  produce the above report. But my fact table has tens of millions of rows, so calculating this table would take a long time, and the join would be really inefficient. Is there a better way of acheiving this same result in a DAX calculation?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @WCONGRAVE ,

In order to provide you a suitable solution, could you please share some sample data in your model (exclude sensitive data) and your expected result with calculation logic and special examples? Thank you.

In addition, you can refer the following links to get it.

yingyinr_0-1641887971870.png

Customers Grouped by Count of Their Orders – Static Segmentation in Power BI

yingyinr_1-1641888204466.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @WCONGRAVE ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.

Best Regards

Anonymous
Not applicable

Hi @WCONGRAVE ,

In order to provide you a suitable solution, could you please share some sample data in your model (exclude sensitive data) and your expected result with calculation logic and special examples? Thank you.

In addition, you can refer the following links to get it.

yingyinr_0-1641887971870.png

Customers Grouped by Count of Their Orders – Static Segmentation in Power BI

yingyinr_1-1641888204466.png

Best Regards

amitchandak
Super User
Super User

@WCONGRAVE , usually we merge and create single table for sales header and sales transactions

 

we can count distinct for sales header

 

or measure like

sumx(summarize(sales, sales[header id], sales[header amount]), [header amount] )

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.