cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
remi Member
Member

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

Accepted Solutions
Community Support Team
Community Support Team

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

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

4 REPLIES 4
Highlighted
Stachu Super Contributor
Super Contributor

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

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!

Proud to be a Datanaut!

Community Support Team
Community Support Team

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

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

remi Member
Member

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

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.

Community Support Team
Community Support Team

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

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

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 240 members 2,750 guests
Please welcome our newest community members: