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 All,
I have the following setup:
CakeShop:
CakeCategory:
CakeManufacturer:
CakeName:
CakeSales:
CakeInventory:
| CCategory | CName | InventoryDateMeasure | ShopName | InventoryMeasure |
| Heavy | Fudge | 10th Oct 24 | East | 50 |
| Fruit | 11th Oct 24 | West | 5 | |
| 18th Oct 24 | North | 25 |
| CCategory | CName | InventoryDateMeasure | ShopName | InventoryMeasure |
| Heavy | Fudge | 10th Oct 24 | East | 50 |
| Fruit | 11th Oct 24 | West | 5 | |
| 18th Oct 24 | North | 25 | ||
| Sponge | 07th Oct 24 | West | 15 | |
| Light Sponge | 12th Oct 24 | South | 17 | |
| Light | Fudge | 10th Oct 24 | East | 50 |
Hi @DallasBaba
Sorry the above doesnt work.
I do now have a demo file, you can find it here https://filebin.net/37c8u0sh8hid3dfq
Thanks
@BugmanJ Can you adjust the filter context to avoid incorrect CName and CCategory combinations?
InventoryDateMeasure =
CALCULATE(
MAX(CakeInventory[InventoryDate]),
FILTER(
CakeInventory,
CakeInventory[ShopID] = SELECTEDVALUE(CakeShop[ShopID]) &&
CakeInventory[CCategory] = SELECTEDVALUE(CakeCategory[CCategory])
)
)
InventoryMeasure =
CALCULATE(
MAX(CakeInventory[Inventory]),
CakeInventory[InventoryDate] = [InventoryDateMeasure], // This will ensure you get the inventory for the latest date
FILTER(
CakeInventory,
CakeInventory[ShopID] = SELECTEDVALUE(CakeShop[ShopID]) &&
CakeInventory[CCategory] = SELECTEDVALUE(CakeCategory[CCategory])
)
)
If the result still show unwanted combinations of CName and CCategory, you can use HASONEVALUE() to ensure only relevant CName values are considered.
CALCULATE(
MAX(CakeInventory[Inventory]),
FILTER(
CakeInventory,
CakeInventory[ShopID] = SELECTEDVALUE(CakeShop[ShopID]) &&
CakeInventory[CCategory] = SELECTEDVALUE(CakeCategory[CCategory])
),
IF(HASONEVALUE(CakeName[CName]), TREATAS(VALUES(CakeName[CName]), CakeSales[CName]))
)
I hope this help, else please @ me with sample of your pbix file
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 |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |