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
Anonymous
Not applicable

Linking Tables - dates

Hi, 

 

I have a master Date table, and I'm trying to link it to a number of other tables, all with Year and Month. The Year and Month columns in my other tables are stored as Text, which I think might be part of the problem, but I can't seem to change this without getting an error... ??

 

MASTER DATE TABLE

Capture15.PNG

 

OTHER TABLES

 

Capture16.PNG

 

Is anyone able to help?

 

Thank you 

Sonia

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

In the Other Table, generate a genuine date from the Month and Year by using this formula

 

=1*("1/"&Table2[Month]&"/"&Table2[Year])

 

Format this new column as Date and give it a meaningful heading.  Now create a relatioship from the Date column (that you just created with the formula above) of the Other Table to the Date column of your caalendar table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

 

In the Other Table, generate a genuine date from the Month and Year by using this formula

 

=1*("1/"&Table2[Month]&"/"&Table2[Year])

 

Format this new column as Date and give it a meaningful heading.  Now create a relatioship from the Date column (that you just created with the formula above) of the Other Table to the Date column of your caalendar table.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you so much, @Ashish_Mathur - this seems to have done the trick! 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur

 

I've tried this same formula in a different table, and now I'm getting the below error message.

 

Any ideas why?

 

Thanks again for your help

 

Sonia

 

Capture20.PNG

Hi,

 

The year and/or month column has atleast one blank cell.  Try this

 

=IFERROR(your formula,DATE(1900,1,1))

 

Does this work?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
rocky09
Solution Sage
Solution Sage

Format the date column in master table with out time stamp. It is better to have a date column in other tables then you can play with the data.
Btw, one table should have unique values.
Anonymous
Not applicable

Hi Rocky, 

 

The reason I have the time stamp is because the main table it's linked to is a list of Facebook posts, which are time stamped.

 

This table is linked to the main Date Table but I need the others linked too. 

 

Any suggestions?

 

Also, how do I convert the dates in my other tables from text?

 

 

Capture6.PNG

You can convert it in query editor.
Anonymous
Not applicable

I get an error in query editor, says it can't convert text

can you share the screenshot of the error?

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.