I am trying to create a date slicer with the dimension table that will reduce records by what has been most recently updated using the calculated column based on the user’s selection.
When I bring in the date dimension into a slicer, all visuals I have become blank.
- I created a date dimension table based on the min/max dates generated from the union of non-null records in three date columns in my fact table (Created Date, Changed Date, Completed Date).
2.I made sure that all date fields have the same data type (date/time)/formatted in short date
-
Marked the new table as a date table.
-
Linked the dimension table to the fact table via a calculated date column called WorkItemDate that addresses the blanks in the Completed Date column (if there is no completed date, the calculated date table will reflect the Changed Date).
The date dimension table is currently generating values and has no null records.
Is there a step I am missing?
Code generating the date table:
DateTable =
VAR MinDate =
MINX(
FILTER(
UNION(
SELECTCOLUMNS('RDA', "Date", 'RDA'[CreatedDate]),
SELECTCOLUMNS('RDA', "Date", 'RDA'[ChangedDate]),
SELECTCOLUMNS('RDA', "Date", 'RDA'[CompletedDate])
),
NOT(ISBLANK([Date])) // Exclude null dates
),
[Date]
)
VAR MaxDate =
MAXX(
FILTER(
UNION(
SELECTCOLUMNS('RDA', "Date", 'RDA'[CreatedDate]),
SELECTCOLUMNS('RDA', "Date", 'RDA'[ChangedDate]),
SELECTCOLUMNS('RDA', "Date", 'RDA'[CompletedDate])
),
NOT(ISBLANK([Date])) // Exclude null dates
),
[Date]
)
RETURN
ADDCOLUMNS(
CALENDAR(MinDate, MaxDate),
"Year", YEAR([Date]),
"Month Number", MONTH([Date]),
"Month Name", FORMAT([Date], "MMMM"),
"Quarter", "Q" & QUARTER([Date]),
"Day of Week", WEEKDAY([Date], 1),
"Day of Week Name", FORMAT([Date], "dddd"),
"Week of Year", WEEKNUM([Date]),
"Is Weekend", IF(WEEKDAY([Date], 1) >= 6, TRUE(), FALSE())
Code generating the new column:
WorkItemDate =
IF (
NOT(ISBLANK(RDA[CompletedDate])),
RDA[CompletedDate],
IF (
NOT(ISBLANK(RDA[ChangedDate])),
RDA[ChangedDate],
RDA[CreatedDate]
)
)
user26852647 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1