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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply

Closest-match Lookup in a measure

I am extending a Harepoint dataset with coloums like 

Site Url | Sites Page =
CALCULATE (
SELECTEDVALUE ( 'Dimension Site Collection'[Url] )
& SELECTEDVALUE ( 'Dimension Site'[Site Collection Relative Url] ),
'Dimension Site'
)
I need to make a match on PARTS of the SITE URL in this column and match it to an area code.
My Lookuptable has two rows URL and CompanyID (which has a relation to another table with ID and NAME)
 
How can I add a column with the companyname (or ID) that matches teh URL closest? I suppose CONTAINSSTRING can help but I dont know how to build a measure with that.
 
So I need the closest-match lookup of "CompanyID" for my "URL"... Any hints are very appreciated
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@wolfgangkb-work Well, there is a fuzzy matching option in Power Query that allows the use of a lookup table or I invented a DAX fuzzy matching measure here: Fuzzy - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @wolfgangkb-work 

Containsstring is usually used to determine whether a string contains another string.

If the strings differ greatly, please try @Greg_Deckler 's solution.

1.png

If it doesn't work, please share your sample file for further research.

Best Regards,
Community Support Team _ Eason

Greg_Deckler
Super User
Super User

@wolfgangkb-work Well, there is a fuzzy matching option in Power Query that allows the use of a lookup table or I invented a DAX fuzzy matching measure here: Fuzzy - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.