Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! 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
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 10 | |
| 7 | |
| 6 |