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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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