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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thanks for chiming in and providing me a solution.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors