Forum Discussion
Merge columns based on conditions
Hi All,
I have requirment
| Column1 | Column2 | Required Result |
| A | 1 | A1 |
| B | 2 | B |
| C | 3 | C |
| A | 4 | A4 |
| A | 5 | A5 |
| D | 6 | D |
| E | 7 | E |
| F | 8 | F |
Should merge the coulmn if the condition gets satisfied or else it should be as column1
Anonymous , Try a new column
if([column1] ="A", [column1] & [column2], [column1] )
Hi Anonymous ,
If you want to create a calculated column using DAX, try what amitchandak mentioned.
If you want to create a custom column using M language, try this:
= if [Column1] = "A" then [Column1] & Number.ToText([Column2]) else [Column1]If you want to create a measure, try this:
Measure = IF ( SELECTEDVALUE ( Table1[Column1] ) = "A", SELECTEDVALUE ( Table1[Column1] ) & SELECTEDVALUE ( Table1[Column2] ), SELECTEDVALUE ( Table1[Column1] ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandak
Super User
Anonymous , Try a new column
if([column1] ="A", [column1] & [column2], [column1] )
- Icey
Community Support
Hi Anonymous ,
If you want to create a calculated column using DAX, try what amitchandak mentioned.
If you want to create a custom column using M language, try this:
= if [Column1] = "A" then [Column1] & Number.ToText([Column2]) else [Column1]If you want to create a measure, try this:
Measure = IF ( SELECTEDVALUE ( Table1[Column1] ) = "A", SELECTEDVALUE ( Table1[Column1] ) & SELECTEDVALUE ( Table1[Column2] ), SELECTEDVALUE ( Table1[Column1] ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.