The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi All,
I've created a date table in my schema in order to do some different "slicing and dicing" but for some reason it doesn't seem to be picking up "new" dates in my table. Even when I hit "refresh" I will still end up with some null values. Any idea why?
Date Table:
Solved! Go to Solution.
Hi @jbrooks91
Thank you very much FarhanJeelani for your prompt reply.
Try this:
Date =
VAR MinDate =
MINX(FILTER('Survey', NOT(ISBLANK('Survey'[responsedate]))), 'Survey'[responsedate])
VAR MaxDate =
MAXX(FILTER('Survey', NOT(ISBLANK('Survey'[responsedate]))), 'Survey'[responsedate])
VAR DateRange =
CALENDAR(MinDate, MaxDate)
RETURN
ADDCOLUMNS(
DateRange,
"Year", YEAR([Date]),
"MonthNumber", MONTH([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"MonthYear", FORMAT([Date], "MMM YYYY"),
"Quarter", "Q" & FORMAT([Date], "Q"),
"YearMonthNumber", YEAR([Date]) * 100 + MONTH([Date]), // Useful for sorting
"MonthIndex", DATEDIFF(MinDate, [Date], MONTH) + 1
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jbrooks91
Thank you very much FarhanJeelani for your prompt reply.
Try this:
Date =
VAR MinDate =
MINX(FILTER('Survey', NOT(ISBLANK('Survey'[responsedate]))), 'Survey'[responsedate])
VAR MaxDate =
MAXX(FILTER('Survey', NOT(ISBLANK('Survey'[responsedate]))), 'Survey'[responsedate])
VAR DateRange =
CALENDAR(MinDate, MaxDate)
RETURN
ADDCOLUMNS(
DateRange,
"Year", YEAR([Date]),
"MonthNumber", MONTH([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"MonthYear", FORMAT([Date], "MMM YYYY"),
"Quarter", "Q" & FORMAT([Date], "Q"),
"YearMonthNumber", YEAR([Date]) * 100 + MONTH([Date]), // Useful for sorting
"MonthIndex", DATEDIFF(MinDate, [Date], MONTH) + 1
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jbrooks91 , It looks like your date table might not be capturing the full range of dates, leading to null values. A few key points to check:
MaxDate Issue:
Your Maxdate is currently set to the start of the month (DATE(YEAR(MAX('Survey'[responsedate])), MONTH(MAX('Survey'[responsedate])), 1)), which might exclude dates after the first day of the last month.
Fix: Use EOMONTH to capture the full month:
DAX
VAR MaxDate = EOMONTH(MAX('Survey'[responsedate]), 0
(Date[Date] -> Survey[responsedate]).
In your visual settings, uncheck "Show items with no data" under the Fields pane if it is selected.
Please mark this as solution if it helps you. Appreciate Kudos.
User | Count |
---|---|
60 | |
55 | |
53 | |
49 | |
30 |
User | Count |
---|---|
179 | |
87 | |
70 | |
48 | |
45 |