Forum Discussion

NickProp28's avatar
NickProp28
Icon for Post Partisan rankPost Partisan
6 years ago
Solved

Perform conditional DAX in Slicer

Dear Community,   I have a 4 column in my table, which is Country, Code, Profit and Revenue. Country Code Profit Revenue PVG ABC 1000 4000 IND DEF 2000 5000 UK QWE 3000 600...
  • Tahreem24's avatar
    Tahreem24
    6 years ago

    NickProp28 ,

    Try to revamp it like below code:

    Final Measure = Switch(True(), MAX(Table[County])="PVG",Calculate( Measure, Table[Code] NOT IN {"ABC", "DEF"}), Table[County]="IND", Calculate( Measure, Table[Code] IN {"ABC", "DEF"}))

     

    NOTE: Measure is the name of calulcated profit which you just posted above.