cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
viitama Frequent Visitor
Frequent Visitor

conditional join

Hi, I'm new to PowerBi and trying to figure out how to join conditionally. I have been able to use merge queries wizard for simple joins, but now I have bit more complex. Here is my two tables and I would like to get Example1 Out column to Example2 table by matching Example2.Date to Example1.StartDate and Example1.EndDate (it should be between those) and Indic. Not sure where I do this, but I would appreciate if answer would incluede some info, where I input my DAX code.

 

image.pngimage.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: conditional join

@viitama,

 

You may refer to the following DAX that adds a calculated column.

Column =
MAXX (
    FILTER (
        Example1,
        Example1[Indic] = Example2[Indic]
            && Example1[StartDate] <= Example2[Date]
            && Example1[EndDate] >= Example2[Date]
    ),
    Example1[Out]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: conditional join

@viitama,

 

You may refer to the following DAX that adds a calculated column.

Column =
MAXX (
    FILTER (
        Example1,
        Example1[Indic] = Example2[Indic]
            && Example1[StartDate] <= Example2[Date]
            && Example1[EndDate] >= Example2[Date]
    ),
    Example1[Out]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
viitama Frequent Visitor
Frequent Visitor

Re: conditional join

this is way better that joins, thanks. Will work on new columns more.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 171 members 1,987 guests
Please welcome our newest community members: