Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to create custom column for a slicer

Hi everyone,    I am new to PowerBi and have quick question. I want to create new collumn called 'country' that would allow me to put it into slicer and when I select specific country it will updat...
  • v-cherch-msft's avatar
    7 years ago

    Hi Anonymous

     

    You may try to use SELECTEDVALUE Function and SWITCH Function to create the measure as requested. For example:

    Value =
    SWITCH (
        SELECTEDVALUE ( Country[Country] ),
        "a", CALCULATE ( SUM ( Table[AT.BUIL] ) ),
        "b", CALCULATE ( SUM ( Table[AT.BUIL2] ) )
    )

     

    Regards,

    Cherie