Forum Discussion
Need help converting date functions from SQL Server to DAX
- 3 years ago
transcend , Assuming you can add three month in place of quarter
Datediff will give number, so not sure how you are using that
Datediff([Date1], [Date2], Day) //in place of date you can use month, quarter, year etc
In place of dateadd, you have to use date
say 3 month in place of quarter
date(Year([MyDate]),Month([MyDate])-1, Day([MyDate]))
Subtract or add days simply
[MyDate] + [Days]
[MyDate]+5
For end of the month
eomonth([MyDate], 0) //current month end date
Date as Dateadd - Decoding Date and Calendar 5-5 - Power BI Turning 5 Celebration Series
https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power-BI-Turning/ba-p/1187827
transcend , Assuming you can add three month in place of quarter
Datediff will give number, so not sure how you are using that
Datediff([Date1], [Date2], Day) //in place of date you can use month, quarter, year etc
In place of dateadd, you have to use date
say 3 month in place of quarter
date(Year([MyDate]),Month([MyDate])-1, Day([MyDate]))
Subtract or add days simply
[MyDate] + [Days]
[MyDate]+5
For end of the month
eomonth([MyDate], 0) //current month end date
Date as Dateadd - Decoding Date and Calendar 5-5 - Power BI Turning 5 Celebration Series
https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power-BI-Turning/ba-p/1187827
- transcend3 years agoFrequent Visitor
Thank you.