98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Power BI training and help » Date table not integrating with raw data
Date table not integrating with raw data
· High Priority · Version 2016
Sammy has attended:
Power BI Modelling, Visualisation and Publishing course
Date table not integrating with raw data
I have coded a date table into my report, however when I use it as a parameter on my raw data, it does not work. My raw data has a date column with a matching format to the date table. I have made a many to one connection in the model view which comes up with no errors. Any advice on how to solve this would be much appreciated, I have attached the DAX code to my date table for reference/proofreading:
Date Table =
VAR StartDate = MIN('Lead Obs RAW'[Date])
VAR EndDate = MAX('Lead Obs RAW'[Date])
VAR DateTable =
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"Year", YEAR([Date]),
"Quarter Name", FORMAT([Date], "\QQ"),
"Quarter number", QUARTER([Date]),
"Month Name", FORMAT([Date], "MMM"),
"Month number", MONTH([Date]),
"Month Year", FORMAT([Date], "MMM YYYY"),
"Month Year Sort", VALUE(FORMAT([Date], "YYYYMM")),
"Week Name", "W" & WEEKNUM([Date]),
"Day Name", FORMAT([Date], "DDDD"),
"Day number", WEEKDAY([Date])
)
RETURN
DateTable
RE: Date table not integrating with raw data
Hi Sammy,
Thank you for the forum question.
It sounds like you’ve put a lot of effort into setting up your date table! Let’s see if we can troubleshoot the issue together. Here are a few things to check:
Date Format Consistency: Ensure that the date formats in both your raw data and date table are exactly the same. Sometimes, even a small difference can cause issues.
Data Types: Verify that the date columns in both tables are of the same data type (e.g., both should be Date type).
Relationships: Double-check the relationship between your date table and raw data. Ensure that the relationship is active and correctly set up as many-to-one.
Date Range: Make sure that the date range in your date table covers all the dates in your raw data. If there are dates in your raw data that fall outside the range of your date table, it could cause issues.
DAX Code Review: Your DAX code looks good, but let’s ensure there are no hidden issues:
Date Table =
VAR StartDate = MIN('Lead Obs RAW'[Date])
VAR EndDate = MAX('Lead Obs RAW'[Date])
VAR DateTable =
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"Year", YEAR([Date]),
"Quarter Name", FORMAT([Date], "\QQ"),
"Quarter number", QUARTER([Date]),
"Month Name", FORMAT([Date], "MMM"),
"Month number", MONTH([Date]),
"Month Year", FORMAT([Date], "MMM YYYY"),
"Month Year Sort", VALUE(FORMAT([Date], "YYYYMM")),
"Week Name", "W" & WEEKNUM([Date]),
"Day Name", FORMAT([Date], "DDDD"),
"Day number", WEEKDAY([Date])
)
RETURN
DateTable
Data Refresh: Sometimes, simply refreshing the data model can resolve integration issues. Make sure to refresh your data after making changes.
If you’ve checked all these and the issue persists, could you provide more details on how you’re using the date table as a parameter? This might help pinpoint the problem more accurately.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Power BI tip:Master DAX (Data Analysis Expressions)DAX is the formula language used in Power BI for creating custom calculations and aggregations. Invest time in learning DAX to unlock the full potential of Power BI. Understand functions like CALCULATE, FILTER, and SUMX, as they are fundamental for creating complex calculations and measures. |