cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Compare Condition of an article, from one day vs the previous day with data

Hello, good afternoon, I need to generate an input condition of a code or article when it enters a certain condition.

I have a stock evolution file, with days not necessarily consecutive, I update it random days, within the condition of the article is the "zone" that occupies according to its actual stock level and its target stock level. This area can be I, II, III, IV, V or VI, in Roman numbers according to this target Stock/Stock relationship. I would like to know in a table that codes went from any area other than I, to zone I, comparing the day where I stand vs the previous one with data and generate a category "I go into zone I".

This is my data table, with articles and zone x article

FedeSalvemini_0-1603234700976.png

Here would be an example of a code that I would like to get into the category:

day 21/8 moves to Zone I.

FedeSalvemini_1-1603234774894.png

I already have the measure "last day" q relates the reference day to the previous one that has data. serious condition. if the zone in "last day"<>"I" and the zone "date down" ""I", "I enter zone 1

1 ACCEPTED SOLUTION
Super User IV
Super User IV

@FedeSalvemini , You can have two new columns like

 

last Fecha = maxx(filter(Table, [codigo] =earlier([codigo]) && [Fecha] < earlier([Fecha]) ),[Fecha])
last Mo_zone = maxx(filter(Table, [codigo] =earlier([codigo]) && [Fecha] = [last Fecha] ),[Mo_zone])

 

For measure approach refer https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @FedeSalvemini ,

 

Is your issue solved now?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Super User IV
Super User IV

@FedeSalvemini , You can have two new columns like

 

last Fecha = maxx(filter(Table, [codigo] =earlier([codigo]) && [Fecha] < earlier([Fecha]) ),[Fecha])
last Mo_zone = maxx(filter(Table, [codigo] =earlier([codigo]) && [Fecha] = [last Fecha] ),[Mo_zone])

 

For measure approach refer https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors