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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 6 | |
| 6 | |
| 6 |