Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Slicer name creation

I need to create column (or) DAX Function

= If 'Name' column contains INT, CAS then "Loss" else  'ALL Name' in the list 'Win'

same thing i will want use in slicer, WIN, LOSS, Pls suggest on create column or DAX Function.

 

Name    

SBU        

INT         

CAS        

IVR

VER

MOD

MOR        

 

Thanks!

  • Hi Anonymous 
    Use Enter Data to create a table called Win_Or_Lose with a column called Choice and add two rows Win and Lose.
    Add this into a slicer.
     
    Create this measure:
     
    Show text measure =
     SWITCH(
        TRUE()
        , SELECTEDVALUE(Win_Or_Lose[Choice]) = "Win"
        ,"Win"
        ,SELECTEDVALUE('Table'[Name]) IN {"INT", "CAS"}
        , "Loss"
        ,""--Hide the rows with BLANK() instead
     )


    Now is should look like this:

     

8 Replies

  • Hello Anonymous 

     

    I made a test, is it what you need:

     

    if yes, this snipet works:

    Test = if('Table'[Name] in {"INT","CAS"},"Loss","Win")
  • New Column = IF( [Name] IN {"INT", "CAS"}, "Loss",  "Win")

    • Anonymous's avatar
      Anonymous
      Not applicable

      doesn't work.. otherthan INT, CAS classified under 'win' as we need all clssified is WIN

       

       

      • SamWiseOwl's avatar
        SamWiseOwl
        Icon for Super User rankSuper User

        New Column =
        Switch(
                  true()
                 ,[Name] IN {"
        INT", "CAS"}, "Loss"  --If in list do this

                 ,[Name] = "ALL Name", "All Win" --If All Name return All Win

                 ,  "Win" --Any other rows return Win
        )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    New column=if(Name column in {"INT","CAS"},"Loss","Win")

     

    Regards,

    SK