Forum Discussion
DAX - Extract Date from TimeStamp (contain date & time)
- 7 years ago
Hi Anonymous,
Please check what data type of your Date column firstly.
If your Date column is Date/Time type in Power BI, you only need to change the Data format to be M/d/yyyy under Modeling.
If your Date column is Text type in Power BI, you could create the measure with the fomula below.
Measure 2 = LEFT(MAX('Table2'[Date]),9)Here is the result.
Best Regards,
Cherry
- Anonymous7 years ago
v-piga-msft I don't have access for modelling the SQL database.
The measure looks legit, I will try on it. Thank you :)
Hi Ashish & all experts here,
Thanks for all your advice, i guess i have to check on the source of my 'Date' [Date] table column, because in the formula, it has the red underlined.
Hi Anonymous,
Please check what data type of your Date column firstly.
If your Date column is Date/Time type in Power BI, you only need to change the Data format to be M/d/yyyy under Modeling.
If your Date column is Text type in Power BI, you could create the measure with the fomula below.
Measure 2 = LEFT(MAX('Table2'[Date]),9)
Here is the result.
Best Regards,
Cherry
- Anonymous7 years agoNot applicable
v-piga-msft I don't have access for modelling the SQL database.
The measure looks legit, I will try on it. Thank you :)
- Anonymous2 years agoNot applicable
Another solution, if you want it to remain a date object and not text is to do something like this:
-Create a new COLUMN
DateColumn = Date[timestamp].[Date]
Then click on the new object and format it to the desired format.