Forum Discussion
MasterSonic
Helper IV
3 years agoAdd column and return values from other column but...
Hi there,
Having a following table
| Code | Group | Color | Hue |
| 101 | PT-15 | Green | Blue |
| 102 | PT-14 | Yellow | Red |
| 103 | CC-11 | Dark | |
| 104 | BA-10 | Black |
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
- MasterSonic
Helper IV
Thanks for your help, but it doesn't work.
I did find this working :
DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK()) - Jayee
Responsive 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!!
- FreemanZ
Super User
try this:
Column = IF( CONTAINSSTRING([Group], "PT"), [Hue], [Color])- MasterSonic
Helper 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()).