Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.