Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
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?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 17 | |
| 11 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 14 | |
| 12 |