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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AlexAlberga727
Resolver II
Resolver II

Retrieving LASTDATE when another column = 0

Folks - 

 

Im looking for a solution to something I would imagine to be very simple. Please help!

 

In the below screenshot you will see a visual which illustrates when specific product's inventory levels go to 0. Once 0, another column starts to calculate "Days not Allocated". I would like to retrieve the LASTDATE that SKU had a Days Not Allocated of 0.

 

For the selected SKU that date would be 5/27/2020.

 

Allocation Example.png

 

If anymore information is need please let me know.

Thanks!

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@AlexAlberga727 - Perhaps:

 

Measure = MAXX(FILTER('Table',[Avail Qty] > 0),[Date])

 

If a column. If a measure, create a table variable that represents the data in your visual (summarized by date for instance, use ADDCOLUMNS to add your measure, do your MAXX over that table variable. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

There doesn't seem to be enough information in your post in order to give you a good answer.
saraMissBI
Resolver I
Resolver I

Hi  @AlexAlberga727 

 

Try the following:

measure = CALCULATE(LASTDATE(Table[Date]), [DaysNotAllocated] = 0)

 

If my answer resolves your issue, please give Kudos and mark as solution.

 

Thank you

Greg_Deckler
Community Champion
Community Champion

@AlexAlberga727 - Perhaps:

 

Measure = MAXX(FILTER('Table',[Avail Qty] > 0),[Date])

 

If a column. If a measure, create a table variable that represents the data in your visual (summarized by date for instance, use ADDCOLUMNS to add your measure, do your MAXX over that table variable. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thanks for chiming in and providing me a solution.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.