This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
9
tip: Did you know dax has datetime literals like `dt"2024-06-06"` and `dt"2015-1-9T02:30:00"`
Post Body
Dax implicitly converts strings to dates, but this is better.
You can confirm this by making a new DAX table.
{
dt"2024-06-06",
date(2024, 07, 07) time(1, 1, 1)
}
If you use a string "2024-06-06"
your column's datatype becomes string
Valid Syntaxes
dt"YYYY-MM-DD"
dt"YYYY-MM-DDThh:mm:ss"
dt"YYYY-MM-DD hh:mm:ss"
If you use the dt
prefix, like dt"2024-06-06"
-- the column's datatype is a real datetime
You can use this to simplify your code when it's using static values. This is from: https://learn.microsoft.com/en-us/dax/dax-syntax-reference#data-types
FILTER (
FactInternetSales,
[OrderDate] > (DATE(2015,1,9) TIME(2,30,0)) && [OrderDate] < (DATE(2015,12,31) TIME(11,59,59))
)
is equivalent to
FILTER (
FactInternetSales,
[OrderDate] > dt"2015-1-9T02:30:00" && [OrderDate] < dt"2015-12-31T11:59:59"
)
see more:
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 7 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerBI/com...