Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
H_insight
Helper V
Helper V

Concatenate multiple columns into single column based on filters

Hi All,

 

I am trying to concatenate 3 columns into 1 based on some filters with DAX measure but not getting much success.

 

Criteria:

  • When a filter is selected i.e. “Program A”
    • Filter data on Type = "Project"
      • Concatenate the following columns:
        • “Id 2”, Update “Summary” and “Updated Type”
          • Ignoring any blank “Updated Type”.
        • H_insight_0-1665912112215.png

           

Expected outcome:

 

H_insight_2-1665913041420.png

 

Sample file.


Many thanks

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@H_insight Maybe:

Summary Measure = 
  VAR __Table = FILTER('Table',[Updated Type] <> BLANK())
RETURN
  CONCATENATEX(__Table, [Id 2] & ", " & [Update Summary] & ", " &  [Updated Type], UNICHAR(10))

Put this in a Card visual.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi

 

Please find a solution in new column

JamesFr06_0-1665921965307.png

Colonne =
var testblank= ISBLANK(Data[Updated Type])
var result=if(testblank = FALSE,COMBINEVALUES(",",Data[id 2],Data[Updated Summary],Data[Updated Type]))

return
result

Thanks @Anonymous for looking into my query. Despite the calculated column showing the concatenated columns, it was not dynamic enough to deliver my table view. Thanks again.

Greg_Deckler
Super User
Super User

@H_insight Maybe:

Summary Measure = 
  VAR __Table = FILTER('Table',[Updated Type] <> BLANK())
RETURN
  CONCATENATEX(__Table, [Id 2] & ", " & [Update Summary] & ", " &  [Updated Type], UNICHAR(10))

Put this in a Card visual.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler fro your help. I have used your measure with a minor tweak to fit my needs in a table:

H_insight_0-1665929400590.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors