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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |