Forum Discussion
how to create a date table with DAX code where there is no end date
- 6 years ago
Hey OPS-MLTSD
this article describe how to create a table using DAX:
https://docs.microsoft.com/en-us/power-bi/desktop-calculated-tables
This is the code to create a table with a given start date that ends with a date that is 10 days ahead of today, there are no quotation marks around the end date parameter:
Dates = CALENDAR("2000-01-01", today( ) + 10)Regards,
Tom
Refer to this article to create a date dimension based on the fact. So when you add data everyday, the date will also be added dynamically.
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
If it helps, mark it as a solution
Kudos are nice too
I have already seen this article previsouly and it does not provide me the solution. If anyone could provide me with the actual DAX code, that would be great. Thank you
- Anonymous6 years agoNot applicable
I always use this below logic in my reports. so there will be no maintenance.
DATES = // TO limit Dates table to only required dates, use dates from Fact table. Ex: SalesVar MinDateDact = MIN(SalesFact[TxDate])VAR MaxDateFACT = MAX(SalesFact[TxDate])RETURNCALENDAR(MinDateDact,MaxDateFACT)