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
Could you supply some sample data (as text, not screen shot) and your measure calculations so that the problem can be recreated? See this post:
http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
For testing I use sample database WorldWideImportersDW
and below my measures
Purchased = CALCULATE(SUM('Fact Purchase'[Ordered Quantity]))Sales = CALCULATE(SUM('Fact Sale'[Quantity]))_meas = IF([Purchased]=[Sales];"OK";"KO")
So I need filtering only rows "OK" or "KO"
- Greg_Deckler9 years agoCommunity Champion
Can you just use a Visual Filter, Page Filter or Report Filter?
- pceglie9 years agoResolver I
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