Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Join on multiple columns using Power query

HI ,   I need to achieve join condition in Power BI similar to sql joins that was generated from other tool. Below is my Join condition that was generated by the tool on the two tables(Sales and Pu...
  • edhans's avatar
    edhans
    6 years ago

    Anonymous I think you might be trying to apply the logic of some other app you are using to Power BI, and that will not work. You don't actually create JOINS in the Power BI data model. You do in Power Query, but not in DAX. In DAX they are filter relationships, and they either equal or they don't.

     

    However, once you have a filter relationship, you can apply other logic in your formulas (measures) to modify how they work. For example, you might have the following to show cumulative sales through a date on your visual:

    Sales Cumulative =
    VAR varCurrentDate =
        MAX( Sales[Date] )
    RETURN
        CALCULATE(
            [Sales],
            Date[Date] <= varCurrentDate,
            REMOVEFILTERS( Dates[Date] )
        )
    

    That will cause the filter to act in a way that will get all sales prior to today through today.

     

    But that is not a merge operation.

     

    Does that make sense? 

    Perhaps tell us what your end goal is, and not ask us to translate Program A logic into Power BI logic. It can cause us to come at this totally wrong, which I've certianly being doing so far. 😁