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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello, I have an indicator that calculates the current balance of goods by calculating the difference between the accumulated totals of the purchased quantity and the quantity sold.
Current balance of goods =
CALCULATE(
[purchased in period)],
FILTER(
ALLSELECTED('Calendar'[Date]),
ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)
)
)
-
CALCULATE(
[sold in period],
FILTER(
ALLSELECTED('Calendar'[Date]),
ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)
)
)
Now I need to get the value of the remainder of goods for the previous day.
It's easy to do it with a physical table, but I can't do it with a DAX. I tried to do it in various ways using DATEADD('Calendar'[Date], -1, DAY), but it didn’t work (either it’s not correct, or I get an error).
Is there a way to do this with the formula ?
Thanks in advance for any help.
Does changing ISONORAFTER to ISAFTER work?
I have found a solution - it is very simple :
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
19 | |
15 | |
7 | |
6 |