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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

naturalinnerjoin date

Hi folks!!

 

Hope you are doing well, and working from home 😉

 

I started to fight with NATURALINNERJOIN function...I hope not to lose 😉

I created 2 tables which are agregation of time from 2 different sources. 

I want to join them  on the date and the location

Table 1 structure

- Date

- Location 

- Time (summation)

 

Table 2: 

- Date

- Location

- Time worked

- Vacation

 

When I use the naturalinnerjoin(Table1, Table2) function, it tells me : Date is already part of the table...which is actually the purpose 😉

 

What do I miss ?

 

PY

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Use COMBINEVALUES to create a calculated column in your tables and then create a relationship between them. Using JOINS like this in DAX is not the best solution or even Best Practice.

Relationships are the best solution and the fastest.

Best
D

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous - You can use SELECTCOLUMNS when joining tables using NATURALINNERJOIN to rename any columns that are the same. In your case, if you want to join on two columns, you would likely want to concatenate those columns together and then join on that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Dear All,

 

Thanks for your feedback!

Actually, I managed to use the relationships to overcome my goal. I reviewed the star schema I created...

 

Thanks a lot

 

PY

Anonymous
Not applicable

I'll tell you more. You should extract Date and Location into their own dimensions and then create a star schema with 2 fact tables. Please see this to know how to correctly model in Power BI:

https://www.youtube.com/watch?v=78d6mwR8GtA&t=1247s

Best
D
Anonymous
Not applicable

Use COMBINEVALUES to create a calculated column in your tables and then create a relationship between them. Using JOINS like this in DAX is not the best solution or even Best Practice.

Relationships are the best solution and the fastest.

Best
D

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors