0
votes

I have a date table with a date column. I would like to add a column which returns YES for dates that are in: Last 12 months & next 4 months

I need to build this column with a DAX formula and directly in Power BI desktop, so "not" in the power query with M language.

Thank you very much in advance!

1
Is it Last 12 months & next 4 months or Last 12 months OR next 4 monthsAnkUser
It is 12 months & next 4 months. Basically I need a period that starts from last 12 months till next 4 months.Hassi

1 Answers

1
votes

This will give you desired result

Note: Columns name vary as per your data.

YesOrNO = IF(DATEDIFF('Table'[Column1],TODAY(),MONTH)>=0,
If(DATEDIFF('Table'[Column1],TODAY(),MONTH)<=12;
"YES","NO"),
If(DATEDIFF('Table'[Column1],TODAY(),MONTH)>=-4;
"YES","NO"))

enter image description here

enter image description here