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.
Hello !
I have to calculate stock adjustments over sales in several stores of a supermarket in the period between the last stock count and today. The thing is that the stock count date is different for each store, and I would also like to decompose the adjustments by product category.
I managed to make a measure that calculates them, but when I want to calculate the ratio aggregated by location the measure is not working.
The data looks like this
| store_id | adjustment_date | product_id | adjustmentCause_id | Quantity | amount |
| 2 | 2020/08/20 | 63 | 3 | 1 | $3.00 |
| store_id | date | product_id | Quantity | amount |
| 2 | 2020/08/20 | 63 | 12 | $36.00 |
The measures I managed to do are this ones.
Solved! Go to Solution.
@rodrigoestrella, try this measure:
Adjustments =
SUMX (
Merms,
IF ( Merms[adjustment_date] >= RELATED ( DimStore[stock_date] ), Merms[amount] )
)
Data model:
By store_id:
By location:
Proud to be a Super User!
@rodrigoestrella, try this measure:
Adjustments =
SUMX (
Merms,
IF ( Merms[adjustment_date] >= RELATED ( DimStore[stock_date] ), Merms[amount] )
)
Data model:
By store_id:
By location:
Proud to be a Super User!
Thanks a lot !!!!! It worked perfectly !!
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 |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 45 | |
| 44 | |
| 41 | |
| 21 | |
| 18 |