This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hey all,
I might have a simple question, but I couldn’t find any solution. I have a List of delivery items with date and quantity. The quantity is positive, when an item is produced and negative, if the item is send. I want to know how many items are on stock. My DeliveryTable is connected to a DateTable.
DeliveryTable:
Item | Date | Quantity |
A | 01.01.2024 | 2 |
B | 02.01.2024 | 5 |
A | 05.01.2024 | -1 |
B | 06.01.2024 | -3 |
There are filters on the measure, generated by the matrix (e.g. Date and Item)
Result wanted in a Matrix:
DateTable[Day] | 01.01.2024 | 02.01.2024 | 03.01.2024 | 04.01.2024 | 05.01.2024 | 06.01.2024 |
A | 2 | 2 | 2 | 2 | 1 | 1 |
| B |
| 5 | 5 | 5 | 5 | 2 |
I have tried the following options to generate the measure:
Option1 REMOVEFILTERS():
Stock =
VAR __LatestDate = MAX(DateTable[Date])
RETURN
CALCULATE(
SUM(DeliveryTable[Quantity]),
REMOVEFILTERS(DateTable[Date]),
REMOVEFILTERS(DeliveryTable[Date]),
FILTER(DeliveryTable, DeliveryTable[Date] <= __LatestDate)
Problem: This does not remove the filters, it just gives me the sum for the selected Date-Range.
Option2 - ALL():
Stock =
VAR __LatestDate = MAX(DateTable[Date])
VAR __Item = SELECTEDVALUE(DeliveryTable[Item])
RETURN
CALCULATE(
SUM(DeliveryTable[Quantity]),
REMOVEFILTERS(DateTable[Date]),
FILTER(ALL(DeliveryTable), DeliveryTable[Date] <= __LatestDate)
FILTER(ALL(DeliveryTable), DeliveryTable[Item] = __Item )
Problem: This works fine as long as I have only one Item selected.
Does anyone know, how I can solve this?
Thanks so much and best regards
Simon
Solved! Go to Solution.
hi @roeggelchen ,
This should do it.
Hey @talespin ,
thanks so much, that works perfectly for me! You really safed my day!
Wish you all the best
Simon
You're welcome.
hi @roeggelchen ,
This should do it.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |