Forum Discussion

MasterSonic's avatar
MasterSonic
Icon for Helper IV rankHelper IV
3 years ago
Solved

Add column and return values from other column but...

Hi there,

Having a following table

CodeGroupColorHue
101PT-15GreenBlue
102PT-14YellowRed
103CC-11 Dark
104BA-10Black 

 

I would like to add another column who works as follows:

Return values from column Color BUT if Group starts with PT return values from colum Hue for these rows.

 

Is it possible please 

  • Thanks for your help, but it doesn't work.

     

    I did find this working :

    DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK())

     

     

     

4 Replies

  • Thanks for your help, but it doesn't work.

     

    I did find this working :

    DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK())

     

     

     

  • Jayee's avatar
    Jayee
    Icon for Responsive Resident rankResponsive Resident

    Hi MasterSonic 

     

    Try below DAX

     

    = If( Left(table[Group],2) = "PT",[Hue],[color])

     

    If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

     

     

  • try this:

    Column = IF( CONTAINSSTRING([Group], "PT"), [Hue], [Color])
    • MasterSonic's avatar
      MasterSonic
      Icon for Helper IV rankHelper IV

      Thumb for help, but yes I solve my problem  after finding code . Still thanks for your post

      DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK()).