The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
20 | |
15 | |
14 | |
9 | |
7 |