Forum Discussion
DrewCarousel
4 years agoFrequent Visitor
Adding date and time fields in formula
Dear community, I have a complicated if and else formulated column where one of the ifs says: ... else if column A <> null then Column B + Column C else... where column B is a date time f...
- Anonymous4 years ago
Hi DrewCarousel ,
You can consider using Dax to achieve:
Here are the steps you can follow:
1. Create measure.
Measure = IF( MAX('Table'[ColumnA]) <> BLANK(),FORMAT(MAX('Table'[ColumnB]),"yyyy-mm-dd"),FORMAT(MAX('Table'[ColumnC]),"hh:nn:ss AMPM"))2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
bcdobbs
4 years agoCommunity Champion
You could pass the year, month, day, hours, minutes etc into:
DATE(2015,1,9) + TIME(2,30,0)
Since August 2021 you can use string literals but wonder if you're using an old version?
https://docs.microsoft.com/en-us/dax/dax-syntax-reference#date-and-time