Forum Discussion
Regnbagar1
Helper I
4 years agoCreate a calculated column for a specifik date range
Hi, I need help with creating a calculated column in my date table, "Date_tabel". I would like to have 1 if it is between last 25:th and the 25:th before that otherwise 0. For example: 1. Tod...
- Anonymous4 years ago
Hi Regnbagar1 ,
Please refer to my pbix file to see if it helps you.
Create a column.
Column = VAR _previous1 = DATE ( YEAR ( EDATE ( TODAY (), -1 ) ), MONTH ( EDATE ( TODAY (), -1 ) ), 25 ) VAR _previous2 = DATE ( YEAR ( EDATE ( TODAY (), -2 ) ), MONTH ( EDATE ( TODAY (), -2 ) ), 25 ) RETURN IF ( 'Table'[date] > _previous2 && 'Table'[date] <= _previous1, 1, IF ( TODAY () >= _previous1, 0, BLANK () ) )If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information.
Best Regards
Community Support Team _ Polly
Anonymous
4 years agoNot applicable
Hi Regnbagar1 ,
Please refer to my pbix file to see if it helps you.
Create a column.
Column =
VAR _previous1 =
DATE ( YEAR ( EDATE ( TODAY (), -1 ) ), MONTH ( EDATE ( TODAY (), -1 ) ), 25 )
VAR _previous2 =
DATE ( YEAR ( EDATE ( TODAY (), -2 ) ), MONTH ( EDATE ( TODAY (), -2 ) ), 25 )
RETURN
IF (
'Table'[date] > _previous2
&& 'Table'[date] <= _previous1,
1,
IF ( TODAY () >= _previous1, 0, BLANK () )
)
If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information.
Best Regards
Community Support Team _ Polly
- Regnbagar14 years ago
Helper I
Thank you so much for the help!