Forum Discussion
Dicken
1 year agoPost Prodigy
DAX DATEATABLE Function
Hi,
is there a way I can create a small start end date table using this function
example of what i want ;
dtab =
DATATABLE(
"start",STRING,
"end", STRING,
{
{"01/01/2020", "31/12/2020"}
}
)
But not as text but as a 'date' I have tried ;
dtab =
DATATABLE(
"start", DATETIME,
"end", DATETIME,
{
{ DATE(2020, 1, 1) + TIME(0, 0, 0), DATE(2020, 12, 31) + TIME(23, 59, 59) }
}
)
I added the time as even though I don't need it I thought it might be the problem, but it still does not work?
any suggestions?
Richard.
But not as text but as a 'date' I have tried ;
dtab =
DATATABLE(
"start", DATETIME,
"end", DATETIME,
{
{ DATE(2020, 1, 1) + TIME(0, 0, 0), DATE(2020, 12, 31) + TIME(23, 59, 59) }
}
)
I added the time as even though I don't need it I thought it might be the problem, but it still does not work?
any suggestions?
Richard.
Does not seem to work, yes returns a table, but
CALENDARAUTO does not find it, so not much use.
Richard.
5 Replies
- Greg_DecklerCommunity Champion
Dicken I know it looks like it won't work but just do this:
dtab = DATATABLE( "start",DATETIME, "end", DATETIME, { {"01/01/2020", "31/12/2020"} } )- DickenPost Prodigy
Does not seem to work, yes returns a table, but
CALENDARAUTO does not find it, so not much use.
Richard.
- parry2kSuper User
Why not use calendar function?
dtTable = CALENDAR ( StartDate, EndDate )- DickenPost Prodigy
becaue I want to use the start month feature of auto.
besides which that is not answering the queston.
- parry2kSuper User
Not sure why that didn't answer the question. why not you define the problem statement