cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User
Super User

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


@ 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!:
Mastering Power BI 2nd Edition

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
Super User
Super User

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


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thanks for chiming in and providing me a solution.

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors