I am trying to convert the following date function from t-sql to dax. My goal is to get the adjusted_date column I got from SQL into PowerBi.
select
EOMONTH(DATEADD (dd, -1, DATEADD(qq, DATEDIFF(qq, 0, [date]) +1, 0)), 1)
;
So far I have DATEDIFF as
DATEDIFF( 0, [date], QUARTER)
however I can't figure out how to do DATEADD. For that I have this:
DATEADD(0, DATEDIFF( 0, [date], QUARTER)+1, quarter)
I got this function from https://dax.guide/dateadd/
I know EOMONTH exists in DAX as show here: https://learn.microsoft.com/en-us/dax/endofmonth-function-dax
I was hoping someone can provide my a hint or help me. Thank you.
date,adjusted_date
2020-01-01,2020-04-30
2020-02-05,2020-04-30
2020-03-22,2020-04-30
2020-04-01,2020-07-31
2020-05-28,2020-07-31
2020-06-19,2020-07-31
2020-07-01,2020-10-31
2020-08-01,2020-10-31
2020-09-17,2020-10-31
2020-10-01,2021-01-31
2020-11-09,2021-01-31
2020-12-20,2021-01-31