The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I need to calculate difference in stock day by day, but sometime previous day doesn't exists.
How can I solve that?
I have tried with the formula below, but it doesn't work when previous day doesn't exists.:
Any suggestions?
Solved! Go to Solution.
@LotteLaugesen Don't use PREVIOUSDAY but rather calculate the previous day using MAXX and filter by days less than the current row. That will give you the latest previous day that you have. Then you can use that to calculate that previous day's value.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434
@Greg_Deckler Thank you for answering, but I can't make work.
I have made this measure:
It seems that it gives the same date not the prior.
And when I try to use in a filter I get an error
So what am I doing wrong?