Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
I have a table from a query:
select employeeId, hours, intime from DW.dbo.payrollstuff
I have a Date Table defined as:
Solved! Go to Solution.
Hi @feelie75
I was just reading your last paragraph and you are mentioning Datetime columns. If the time portion is required, you'll have to make a copy of that column and change the copy to a type of Date to use in the relationship.
The reason for this is the relationship to the date table would only match columns with 00:00:00 since they would match the date column in the date table. (Columns with a time portion other than 00:00:00 wouldn't match in the relationship.)
I hope this makes sense.
Yep, that was the secret sauce, gmsamborn! I just changed my SQL query to: cast(intime as Date), and then it was able to match.
I didn't know that a relationship between two tables ignored the "Formatting" when I changed it to Date. That apparently ONLY changes the formatting, but the data itself still remained date/time, so the join was only happening on the 00:00:00 payroll entries.
Changing the query to cast the value as date forced ALL entries to have 00:00:00 as their time component, and thus the relationship join now works!
Or changing the type in the column to Date as you recommended would also work. Thanks for leading me down and confirming that. Cheers!
Glad that helped. (I've seen that more than a couple of times.)
Hi @feelie75
I was just reading your last paragraph and you are mentioning Datetime columns. If the time portion is required, you'll have to make a copy of that column and change the copy to a type of Date to use in the relationship.
The reason for this is the relationship to the date table would only match columns with 00:00:00 since they would match the date column in the date table. (Columns with a time portion other than 00:00:00 wouldn't match in the relationship.)
I hope this makes sense.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.