Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi! Can anyone point me toards a starting point for this problem. This is my dashboard:
I have a table with products and stock. Some of the stock has been marked with an 'action' e.g. sell or destroy
I want the user to be able to select the action(s) and then see what would be total stock afterwards, if we removed all the stock marked with that action.
i.e. in this visual, the user can see current total stock on the left, they then select one or more actions in the middle, and the cards on the right would show what the total stock would be after removing that stock:
I have managed to make a couple of measures which kind of do this:
This one goes in the card for Remaining Stock:
UoM Exclude = [UoM Include] - [UoM TM]
This one goes in the card for Total Stock, and the interaction between the filter has also been turned off:
UoM TM = CALCULATE(
SWITCH(TRUE(),
VALUES(SwitchUoM[SwitchUoM]) = "Value GBP", [SumValue],
VALUES(SwitchUoM[SwitchUoM]) = "Volume AC", [SumVolumeAC],
VALUES(SwitchUoM[SwitchUoM]) = "Volume EU", [SumVolumeEU],
VALUES(SwitchUoM[SwitchUoM]) = "No. of SKUs", [SumDistinctSKUs],
[SumVolume9L])
, FILTER(ALL(Inventory[InventoryDate]) , Inventory[InventoryDate] = MAX(Dates[Date]))
)+0
And this is the measure which just sits inbetween to make the caluclations work:
UoM Include =
CALCULATE(
SWITCH(TRUE(),
VALUES(SwitchUoM[SwitchUoM]) = "Value GBP", [SumValue],
VALUES(SwitchUoM[SwitchUoM]) = "Volume AC", [SumVolumeAC],
VALUES(SwitchUoM[SwitchUoM]) = "Volume EU", [SumVolumeEU],
VALUES(SwitchUoM[SwitchUoM]) = "No. of SKUs", [SumDistinctSKUs],
[SumVolume9L])
,
FILTER(ALL(Inventory[InventoryDate]) , Inventory[InventoryDate] = MAX(Dates[Date])),
ALL(Inventory[Action])
)+0
Howver, when I deselect everything, it shows zero instead of showing total stock.
Any help? Why is it showing zero and how can I fix it?
Solved! Go to Solution.
I fixed it using:
UoM Exclude = IF ( ISFILTERED ( Inventory[Action] ), ([UoM Include] - [UoM TM]), [UoM TM] )
I fixed it using:
UoM Exclude = IF ( ISFILTERED ( Inventory[Action] ), ([UoM Include] - [UoM TM]), [UoM TM] )
Hi @dapperscavenger ,
Please kindly Accept it as the solution. More people will benefit from it.
Best Regards,
Stephen Tao
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |