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
remi
Advocate II
Advocate II

DAX for a dynamic number of columns that have 95% the same name

Hello,

 

Want to concatenate only the columns that start with Column.

 

e.g. 3 out of 140 columns that start with Column, but they change in the name  like Coumn_1; Column_7; Column_21

 

 

Can you help me with the dax for this? 

 

Thank you!

1 ACCEPTED SOLUTION

Hi @remi

It seems my pbix provides the same way as you described, could you have a look at it and tell me whether it helps or not?

 

Best Regards

maggie

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @remi

How do you concatenate the columns?

Is it like below?

Original table

3.png

Final table

4.png

 

Here is my pbix

 

Best Regards

Maggie

hello @v-juanli-msft,

 

Created a new column with the merged content in the query view and then moved to a new formula to check for my text in the table view.

Hi @remi

It seems my pbix provides the same way as you described, could you have a look at it and tell me whether it helps or not?

 

Best Regards

maggie

Stachu
Community Champion
Community Champion

AFAIK in DAX whenever you reference a column it has to be explicit reference, there is no equivalent of Excel INDIRECT, so in DAX you need to write the code

what you could try is unpivoting these columns in Query Editor so they would be all in one column with values in the other one and then using CONCATENATEX with criteria on the column with names stored - not sure it applies to your logic though



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

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.