locked
Measure in slice Filter RRS feed

  • Question

  • Hello Everyone,

       I have a measure that return me text value (Top, Bottom, Stable), i want to use this measure like filter. For that i create a table that returns me the value : Top, Bottom, Stable and i use haseonevalue : 


    TABLE1
    Key Table_Name

    2                  Bottom
    3                  Stable

    1                 Top

    Measure := IF(Measure1>Measure2;"Top";IF(Measure1<Measure2;"Bottom";"Stable"))

    Measure Filter:= IF(HASONEVALUE('Table1'[Table_Name]);Measure;BLANK())

    And that don't work :( . Someone can help me please.

    Regards,

    Amar


    Reponse

    Thursday, March 7, 2019 9:24 AM

Answers

  • Hello,

      Finally i find the solution. With the switch function :

    Measure Filter := 

    IF(
    HASONEVALUE('Table1'[Table_Name]);
    SWITCH (VALUES('Table1'[Table_Name]);
    "Top"; IF(Measure1>Measure2;"Top";BLANK());
    "Bottom"; IF(Measure1<Measure2;"Bottom";BLANK());
    "Stable" ; IF(Measure1=Measure2;"Stable";BLANK());
    );BLANK())

    Hope that can help someone.


    Reponse


    • Marked as answer by Adghar Thursday, March 7, 2019 12:07 PM
    • Edited by Adghar Thursday, March 7, 2019 12:07 PM
    Thursday, March 7, 2019 12:07 PM