Forum Discussion
Dynamically Enable and Disable Date Dropdown
Hi lucadelicio
Use a physical datetime column instead of the one generated by the Auto Datetime hierarchy. As a best practice, disable Auto Datetime and explicitly create the datetime attributes yourself. Auto Datetime creates a hidden table for almost every datetime column in the model, which unnecessarily bloats the model.
Date =
ADDCOLUMNS(
CALENDAR(DATE(2018,1,1), DATE(2021,12,31)),
"Year", YEAR([Date]),
"Month Number", MONTH([Date]),
"Month", FORMAT([Date], "MMMM"),
"Month Short", FORMAT([Date], "MMM"),
"YearMonth", FORMAT([Date], "YYYY-MM"),
"Quarter", "Q" & FORMAT([Date], "Q"),
"YearQuarter", FORMAT([Date], "YYYY") & " Q" & FORMAT([Date], "Q"),
"Day", DAY([Date]),
"Weekday Number", WEEKDAY([Date], 2), -- Monday = 1
"Weekday", FORMAT([Date], "dddd"),
"Weekday Short", FORMAT([Date], "ddd")
)Thank you danextian for the answer.
I'm not using the automatic date/time period (is disable) i create a specific hierarchy as the best practice mode.
Infact is working but the problem remains the previous selected value when i change from Custom to Selected period. Also the "All" value is not so clear for the final user.
See the image post.
Probably the only way for now is to create a Bookmark and add an ADDITIONAL button and so add an additional click to the final user. Way that i would like to avoid.
Thank you anyway