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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
EnzoVAUTOR
Regular Visitor

Conatenate all "alias" of matching values

Hello,


i'm an old french  VBA lover who hope to get the train of Power Bi. 

I'm looking for a Power query or a DAX functions which permit me to match values which could have wildcards.

I Have to table the first one called :  TabCorr; which permit me to get from an accounting codification/concatenation to get segment titles.


TabCorr

NomFocusConcatUA
GlobalStéAàStéB150~??????~C000362
GlobalStéAàStéB250~??????~C000502
GlobalStéAàStéB350~??????~F026345
VentesStéAàStéB150~707???~C000362
AchatsStéAàStéB150~607???~F026345
AchatsStéAàStéB1_8.550~607020~C000362
AchatsStéAàStéB1_2.150~607021~C000362
VentesMarchandises8.5HHHàMMX50~707010~C000362
VentesMarchandisesExoHHHàMMX50~707011~C000362

My actual power query advenced editor for this table look like that : 
let
Source = Excel.Workbook(File.Contents("C:\Users\hmenva\OneDrive - HOHIOHEN Automobile\InterCoSté\TableCorrInterCo.xlsx"), null, true),
TabCorr_Table = Source{[Item="TabCorrVentesEtAchats",Kind="Table"]}[Data],
#"Type modifié" = Table.TransformColumnTypes(TabCorr_Table,{{"NomFocus", type text}, {"CodeStéUA", type text}, {"NumCompteUA", type text}, {"ContrePartieUA", type text}, {"ConcatUA", type text}, {"CodeStéUB", Int64.Type}, {"NumCompteUB", type text}, {"ContrePartieUB", type text}, {"ConcatUB", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Type modifié"," ","",Replacer.ReplaceText,{"ConcatUA"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Id", Int64.Type}})
in
#"Changed Type"

 

 

 

And a table

ListOfEligiblesECPIE which the list of the accounting rows which match with the list of ConcatUA

ConcCatUniv ECPIE émetteur
50~607020~C00036280523654
50~607020~C00036258963222
50~707???~C00036255555555
  
  

 with this advanced editor code :

let
Source = Table.Combine({GL_HHH, GL_MMX, GL_CGA, GL_MSP, GL_OIPA}),
FocusOnNeededColumns = Table.Distinct(Table.SelectColumns(Source,{"ConcatUniv","ECPIE"})),
EligibleList = Table.SelectRows(FocusOnNeededColumns, each (List.Contains(SearchingEligibleConcatEmetteur, [ConcatUniv])=true)),
#"Renamed Columns" = Table.RenameColumns(EligibleList,{{"ECPIE", "ECPIEémetteur"}}),
AddAllFocusNamesPossibilities = Table.AddColumn(#"Renamed Columns","FocusPossibles", each List.Accumulate(Table.ToList(Table.FromColumns({"ConcatUA","NomFocus"}),Combiner.CombineTextByDelimiter(",")),"",(state,current)=>
if Text.Contains([Column 2], current)
then current&"/"&state
else state
))
in
AddAllFocusNamesPossibilities

 

 What i'm trying to ask is : to add a list or simply a concatenation into a new column called ListOfEligiblesECPIE[FocusPossibles] to this second table which will give me all the TabCorr[NomFocus] when TabCorr[ConcatUA] is matching even partially due to wildcards with ListOfEligiblesECPIE[ConcatUniv].

Something like that :

ListOfEligiblesECPIE

ConcCatUniv ECPIE émetteurFocusPossibles
50~607020~C00036280523654GlobalStéAàStéB1, AchatsStéAàStéB1,AchatsStéAàStéB1_8.5 
50~607021~C00036258963222GlobalStéAàStéB1, AchatsStéAàStéB1,AchatsStéAàStéB1_2.1
50~707010~C000362707456123GlobalStéAàStéB1, VentesStéAàStéB1, VentesMarchandises8.5HHHàMMX
50~707011~C000362707123456GlobalStéAàStéB1, VentesStéAàStéB1, VentesMarchandisesExoHHHàMMX

 

I'am sorry for my english skills, i will really pleased to hear you for any solution from power query or even from dax in a custom column 

0 REPLIES 0

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.