Forum Discussion

Pooji's avatar
Pooji
Regular Visitor
4 years ago

Switch Statement in Custom column

Hi,

I am having the below column as DAX measure. Can anyone help me in writing the same statement while creating Custom Column.

Count of Comapnies = SWITCH(
'Data - Unpivot'[Fund - Copy], "Omega IV", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy]= "Omega IV")), "Omega V", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy] = "Omega V")), "Omega VI", CALCULATE(COUNTROWS('Data - Unpivot'),FILTER('Data - Unpivot','Data - Unpivot'[Fund - Copy] = "Omega VI")))

 

 

3 Replies

  • Pooji , if this a measure then what you given can work as measure

    'Data - Unpivot'[Fund - Copy]

     

    If the above is column for measure you need

    max('Data - Unpivot'[Fund - Copy]) or selectedvalue('Data - Unpivot'[Fund - Copy])

     

    else the above should work as column too

     

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • Pooji's avatar
    Pooji
    Regular Visitor

    Yeah amitchandak 

     

    I am getting error, when am trying to create custom column using the below formula. Please help me in achieving this.