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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
admin_xlsior
Post Prodigy
Post Prodigy

Matching between two unrelated tables

Hello guys,

 

Need a few help with my case on finding match and unmatch between two unrelated table. I know I need to use LOOKUPVALUE for this, but somehow I can't get it right.

 

So here is the sample data looks like :

I have a master data for Places like this ->

PlaceForHobby
Place1Gof
Place2Fishing
Place3Run
Place4Basketball
Place5Swimming

 

And another table which is Person list with ther hobby and places that he already rented ->

PersonHobbyRent
AFishing 
AGolfPlace1
BRunPlace3
BFishingPlace2
BBasketballPlace4
CSwimmingPlace5
DGolf 
DRun 
ERun 
EBasketball 

 

As we can see in this table, with a person's hobby information, there are some with no infomation of rented place. What I expect is a list of Prospect person that I can introduced fo rent (new rent) based on their hobby, match with the hobby information of the places.

 

Probably something list this :

Prospect Places

PlacePerson
Place1D
Place2A
Place3D
Place3E
Place4E

 

Like wise, if the list turn to be person's POV and in descriptive manner : Person A there is Place1 he can rent, and for Person D, Place 1 and Place 3 applicable for rent.

 

In extend to this atually we can have a list like Places and how many people rented the same place.

 

How the DAX will be like ?

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

@admin_xlsior 
You mean like this? https://www.dropbox.com/t/RVZVoMC7wz3HEDPY

1.png

Recommended People = 
VAR T1 = 
    FILTER (
        'Person List', 
        'Person List'[Hobby] = SELECTEDVALUE ( 'Master Data'[ForHobby] )
            && 'Person List'[Rent] = BLANK ( ) 
    )
RETURN
    CONCATENATEX (
        T1,
        [Person],
        UNICHAR ( 10 )
    )
Recommended Places = 
VAR T1 = 
    SELECTCOLUMNS (
        FILTER (
            'Person List', 
            'Person List'[Rent] = BLANK ( ) 
        ),
        "@Hobby", 'Person List'[Hobby] 
    )
RETURN
    CONCATENATEX (
        FILTER ( 'Master Data', 'Master Data'[ForHobby] IN T1 ),
        'Master Data'[Place],
        UNICHAR ( 10 )
    )
Number of People Rented = COUNTROWS ( 'Person List' )

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

HI @admin_xlsior 
Sory I did not understand the 2nd part of the question.

For the first part you can use https://www.dropbox.com/t/oLMQSLa6CxHS7MNF

1.png

Recommended People = 
VAR T1 = 
    FILTER (
        'Person List', 
        'Person List'[Hobby] = SELECTEDVALUE ( 'Master Data'[ForHobby] )
            && 'Person List'[Rent] = BLANK ( ) 
    )
RETURN
    CONCATENATEX (
        T1,
        [Person],
        UNICHAR ( 10 )
    )

 

Hi @tamerj1 

 

Let me digest and learn your pbix first, but it looks cool already 😀

 

Yeah, for the People's POV, means the table, column is People first. So if follows your table it may looks like : 

admin_xlsior_0-1654086064230.png

 

And what I mean by Places and how many people rented is like this :

admin_xlsior_1-1654086268143.png

but this is very very simple, is just a simple Count. Just saying possiblity of reports.

 

Thank you very much.

 

 

 

@admin_xlsior 
You mean like this? https://www.dropbox.com/t/RVZVoMC7wz3HEDPY

1.png

Recommended People = 
VAR T1 = 
    FILTER (
        'Person List', 
        'Person List'[Hobby] = SELECTEDVALUE ( 'Master Data'[ForHobby] )
            && 'Person List'[Rent] = BLANK ( ) 
    )
RETURN
    CONCATENATEX (
        T1,
        [Person],
        UNICHAR ( 10 )
    )
Recommended Places = 
VAR T1 = 
    SELECTCOLUMNS (
        FILTER (
            'Person List', 
            'Person List'[Rent] = BLANK ( ) 
        ),
        "@Hobby", 'Person List'[Hobby] 
    )
RETURN
    CONCATENATEX (
        FILTER ( 'Master Data', 'Master Data'[ForHobby] IN T1 ),
        'Master Data'[Place],
        UNICHAR ( 10 )
    )
Number of People Rented = COUNTROWS ( 'Person List' )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors