Power BI: match values between 2 columns then concatenate
In IT, particularly in the incident management, we have a parent column, and sometimes, I want to concatenate the child tickets:
NOTE: if I have another table, I can get the same result from this other table, at the end of the article, I explain how
To know if “number” is in “parent”, I will match them. I will add a new column:
Then put this formula:
IF(NOT(ISBLANK(LOOKUPVALUE('table'[argument1],'table'[argument1],'table'[argument2]))),"value")
NOTE: change table, argument1, argument2 and value by yours
Alternatively, I can use this formula if the one above is not working with your data:
var num=[argument2] return IF(COUNTROWS(FILTER('table',CONTAINSSTRING('table'[argument1],num)))>0,"value")
Next, I want to get a list of number tickets that share the same ID in the “parent” column. In fact, I will concatenate the “number” column based on the value in the “parent” one, I will need to match again the values between those 2 columns in order to get it with this formula:
IF(NOT(ISBLANK('table'[argument1])),CONCATENATEX(FILTER('table','table'[argument1]=EARLIER('table'[argument1])),'table'[argument2]," "))
NOTE: to separate the ticket number, for instance, by a coma instead of a space, change " " by ","
As you can see, INC004 is duplicate so to remove it:
IF(NOT(ISBLANK('table'[argument1])),CONCATENATEX(SUMMARIZE(FILTER('table','table'[argument1]=EARLIER('table'[argument1])),'table'[argument2]),'table'[argument2]," "))
Now if I want to have the results to be in the same row as the matching value of the “number” column, I just need to do those small changes to the formula:

In case if I have 2 tables, and I want the result to display in the “Table2” instead of the “Table1”, there are again small changes to do, for instance:


NOTE:
- For calculating values, read Power BI: calculate values by group
- To concatenate values based on condition, read Power BI: combine words based on criteria
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...






