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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
metin
Frequent Visitor

Calculating Max of a column with grouping based on dates

Hi All,

 

I have an inventory table showing inventory status of products historically. Table looks like as below.

 

Product - Quantity - Inventory Date

Prod. A - 10 - 21.12.2020

Prod. B - 5 - 21.12.2020

Prod. A - 15 - 14.12.2020

Prod. B - 1 - 14.12.2020

Prod. A - 5 - 7.12.2020

Prod. B - 15 - 7.12.2020

 

The two measures I would like to get is, total max / min inventory value based on dates.

On this example total inv. value on each date is,

21.12.2020 - 15

14.12.2020 - 16

7.12.2020 - 20

 

So I expect the max measure to give me the result of 20 (which is 7.12.2020) and min measure to give me the result of 15 (which is 21.12.2020).

 

Looking forward to hear your suggestions & ideas.

 

Thanks,

Metin

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@metin , Try a measure like

maxx(values(Table[Inventory Date]), calculate(Sum(Table[Quantity])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
metin
Frequent Visitor

@amitchandak Thanks a lot, it is working very well. And one more question, how can I show the date of max or min inventory (from example I would like to see 21.12.2020)?

amitchandak
Super User
Super User

@metin , Try a measure like

maxx(values(Table[Inventory Date]), calculate(Sum(Table[Quantity])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors