Forum Discussion

trogne's avatar
trogne
Helper I
2 years ago
Solved

Two tables linked by date

I have 2 queries, each with a date column.   I want to link those date columns, so that I can use only one date slider for both queries.   I tried to create a relation with the 2 date columns (on...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,trogne 

    Thanks for the quick reply.

     

    Yes, you are right, "time" is a calculation table.

     

    Secondly, regarding the issue that your calculation table cannot lock the relevant columns, you must have noticed from the pbix file we shared earlier that the calculation table is working fine in our file, so we speculate that this may be a version issue, so we recommend that you try to download the latest version.

     

    Here is the official download link for the latest version:

    Download Microsoft Power BI Desktop from Official Microsoft Download Center

     

    Secondly, you can also try the following two calculation tables in your version, I hope it will help you:

    time = 
    VAR time1=SELECTCOLUMNS('Forge','Forge'[Date])
    VAR time2=SELECTCOLUMNS('Local1234','Local1234'[Date])
    RETURN UNION(time1,time2)
    time = 
    VAR time1=SELECTCOLUMNS('Forge',"1",'Forge'[Date])
    VAR time2=SELECTCOLUMNS('Local1234',"2",'Local1234'[Date])
    RETURN UNION(time1,time2)


    You may need to note that if you re-calculate the following two columns, the names of the columns generated by it may change, and you will need to reconfigure the table relationships.

     

    Here are the relevant links:

    SELECTCOLUMNS function (DAX) - DAX | Microsoft Learn

    UNION function (DAX) - DAX | Microsoft Learn

     

    If you have any new discoveries, please feel free to contact us.

     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.