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.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

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.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 300 members 2,726 guests
Please welcome our newest community members: