The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
108 | |
78 | |
77 | |
46 | |
39 |
User | Count |
---|---|
137 | |
108 | |
64 | |
64 | |
53 |