Forum Discussion

pceglie's avatar
pceglie
Icon for Resolver I rankResolver I
9 years ago
Solved

Filter by a measure

Hi folks, I have one table with 2 measures

"Total Revenues" , "Total Budget"

I have a 3rd measure that prints "OK" if the first 2 columns have the same value otherwise prints "KO" if Total Revenues" <> "Total Budget". 

Works fine, but I can't insert a Slicer Filter to filter only rows with "OK" (or "KO") values

Any suggestion is appreciated.

Thanks,

  • pceglie

     

    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

9 Replies

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    You can't put a measure as a slicer choice. You could try adding a bar chart with the 2 text items on the axis and count as the value. Then try clicking the bars