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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
RVL
Regular Visitor

Count per day the maximum that one product is ordered per productgroup

Hi need some help as beginner,

 

I have 1.5 million orderlines and around 8000 individual materials (product). 

Per day the same material is being ordered multiple times. 

I would like to know per day what the max is that a material is ordered per productgroup.

So for example that on Monday 5 october the max for the same material in category 'T-shirts' have been ordered 186 times.

I want to show this in a clustered column chart, with selection of dates on X,  max number of same material ordered on Y and category as legend.  

 

I have a fact table with orderlines.

Per orderline I have: "material_ID", "order_date" (and more)

 

In a dimension table I have material information: "material_ID", "product_category".

 

How can I approach this?

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @RVL ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1601886048454.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @RVL ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1601886048454.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lionel-msft Thanks!

amitchandak
Super User
Super User

@RVL , Create a rank like this and filter on 1

 

Measure =
var _tab = AddColumns(summarize(Material, material[product_category], orderlines[orderDate],"_1",sum(orderlines[Qty]))
return
rankx(filter(_tab,[orderDate] =max([orderDate])),[_1],,desc,dense)

 

I have not tested this

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

Orderlines and product_category are not in 1 same table. I think that is needed for your solution correct?

@RVL 

summarize we can take columns from related tables.  I have shown that from different tables

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
Anonymous
Not applicable

Could you show an example and desired result?

If this is the data:

 

Material_IDOrder dateCategory
111112-10-2020T-shirt
111112-10-2020T-shirt
111112-10-2020T-shirt
111112-10-2020T-shirt
111112-10-2020T-shirt
222222-10-2020T-shirt
333332-10-2020

Shorts

555552-10-2020

Shorts

 

I would want to see that on 2-10-2020 the max that the same T-Shirt is ordered is 5 and for Short this is 1.

 

Thanks

Helpful resources

Announcements
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.