Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to merge all these columns as shown in Table 1 to get a new column as 'Result Column'
Table 1:
Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |
ABC | DEF | DEF | ||
DEF | ABC | MNO | ||
GHI | ABC | DEF | JKL | |
JKL | GHI | PQR |
Result Column |
ABC,DEF,DEF |
DEF,ABC,MNO |
GHI,ABC,DEF,JKL |
JKL,GHI,PQR |
Solved! Go to Solution.
Hi @Pooja_Mishra ,
You can use the following dax to create a new column:
Result Column =
VAR TEST1 =
IF (
'Table'[Column 2] = BLANK (),
'Table'[Column 1],
'Table'[Column 1] & "," & 'Table'[Column 2]
)
VAR test2 =
IF ( 'Table'[Column 3] = BLANK (), test1, test1 & "," & 'Table'[Column 3] )
VAR test3 =
IF ( 'Table'[Column 4] = BLANK (), test2, test2 & "," & 'Table'[Column 4] )
VAR test4 =
IF ( 'Table'[Column 5] = BLANK (), test3, test3 & "," & 'Table'[Column 5] )
RETURN
test4
And final you will get like below:
Wish it is helpful for you !
Best Regards
Lucien
Hi @Pooja_Mishra ,
Based on your table,do like this:
Result =
VAR TEST1 =
IF (
'Application Catalogue_DAU'[Business Division_1] = BLANK (),
'Application Catalogue_DAU'[Business Division],
'Application Catalogue_DAU'[Business Division] & "," & 'Application Catalogue_DAU'[Business Division_1]
)
VAR test2 =
IF (
'Application Catalogue_DAU'[Business Division_4] = BLANK (),
test1,
test1 & "," & 'Application Catalogue_DAU'[Business Division_4]
)
VAR test3 =
IF (
'Application Catalogue_DAU'[Business Division_7] = BLANK (),
test2,
test2 & "," & 'Application Catalogue_DAU'[Business Division_7]
)
RETURN
test3
Return the last "test"
Best Regards
Lucien
Hi @Pooja_Mishra ,
You can use the following dax to create a new column:
Result Column =
VAR TEST1 =
IF (
'Table'[Column 2] = BLANK (),
'Table'[Column 1],
'Table'[Column 1] & "," & 'Table'[Column 2]
)
VAR test2 =
IF ( 'Table'[Column 3] = BLANK (), test1, test1 & "," & 'Table'[Column 3] )
VAR test3 =
IF ( 'Table'[Column 4] = BLANK (), test2, test2 & "," & 'Table'[Column 4] )
VAR test4 =
IF ( 'Table'[Column 5] = BLANK (), test3, test3 & "," & 'Table'[Column 5] )
RETURN
test4
And final you will get like below:
Wish it is helpful for you !
Best Regards
Lucien
@Pooja_Mishra , Try like this as new column in dax
[Column 1] & if(not(isblank([Column 2])),", " [Column 2], "") & if(not(isblank([Column 3])),", " [Column3], "") & if(not(isblank([Column 4])),", " [Column 4], "") & if(not(isblank([Column 4])),", " [Column 4], "")
Thanks for your response. I tried it but did not work
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |