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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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