cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

viitama Frequent Visitor
Frequent Visitor

Re: conditional join

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 79 members 2,687 guests
Please welcome our newest community members: