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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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. 


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!:
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. 


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!:
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.