Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Enila123
Regular Visitor

Power BI: DAX or M and how to JOIN

Hello everyone,

 

I've got a problem to join two tables in a certain way. These are the data that I get via live connection to SSAS:

 

Table 1:                                                     Table 2:

 

   Date                                                           ID                       myValue              StartDate            EndDate

01/01/17                                                        1                            40                   01/01/17            15/02/17

01/02/17                                                        1                            45                   16/02/17            31/03/17

01/03/17                                                        1                            50                   01/04/17               NULL   (which means until today)

01/04/17                                                        2                            80                   15/12/16            02/06/17

     [...]                                                            [...]                          [...]                        [...]                      [...]

 

 

 

For my reporting I need the following table:

 

   ID                       myValue              StartDate            EndDate           myDate

    1                            40                   01/01/17            15/02/17          01/01/17

    1                            40                   01/01/17            15/02/17          01/02/17

    1                            45                   16/02/17            31/03/17          01/03/17

    1                            50                   01/04/17               NULL             01/04/17

    2                            80                   15/12/16            02/06/17          01/01/17

    2                            80                   15/12/16            02/06/17          01/02/17

    2                            80                   15/12/16            02/06/17          01/03/17

    2                            80                   15/12/16            02/06/17          01/04/17

   [...]                          [...]                        [...]                      [...]                    [...]

 

 

So I need to join them considering the date. For every date that is in the Table1 I have to check if it's between StartDate and EndDate and create a new row with the new column myDate (which is filled by Date from Table1).

 

Does anyone know a possiblity to solve that problem? I'm not even sure if I have to work with DAX or M. There aren't many JOIN functions and I'm not supposed to prepare the data already by using SQL before.

 

Thanks a lot!

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Enila123,


Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Enila123,

 

You can't do with DAX or M due to the live connection to SSAS. You can try it yourself. Maybe you can do it in the SSAS model.Power BI DAX or M and how to JOIN.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.