Forum Discussion
Filter by a measure
- 9 years ago
We can't directly put a measure into a slicer since the measure need to be sliced to get the corresponding data. In your scenario, you can create a calculated table and build those measures into calculated column, then you can use apply slicers on these columns.
Calculated Table = ADDCOLUMNS( Table, "Purchased",CALCULATE(SUM('Fact Purchase'[Ordered Quantity])), "Sales",CALCULATE(SUM('Fact Sale'[Quantity])), "_meas", IF([Purchased]=[Sales];"OK";"KO") )Regards,
Simon Hou
Can you just use a Visual Filter, Page Filter or Report Filter?
I need a Visual Filter
- v-sihou-msft9 years agoMicrosoft Employee
We can't directly put a measure into a slicer since the measure need to be sliced to get the corresponding data. In your scenario, you can create a calculated table and build those measures into calculated column, then you can use apply slicers on these columns.
Calculated Table = ADDCOLUMNS( Table, "Purchased",CALCULATE(SUM('Fact Purchase'[Ordered Quantity])), "Sales",CALCULATE(SUM('Fact Sale'[Quantity])), "_meas", IF([Purchased]=[Sales];"OK";"KO") )Regards,
Simon Hou
- drad7 years agoHelper I
How do you build this table? Where do you write the script you supplied?
Is there any documentation you can supply to show how this is done?
Thanks,
Dan.
- Greg_Deckler9 years agoCommunity Champion
I may be incorrect, but I'm not sure that is possible. The reason is that since it is a measure, it has a value in a visual only according to the specific context of that visual. Filters are special in that they allow measures to be used to filter visuals versus all of the visuals aren't going to allow you to do this in the way you want. There may be a tricky way around it but I'm not thinking of it right now. I seem to remember that perhaps there was a way around this or a similar problem by using VALUES...