Forum Discussion
Yazid
Helper I
2 years agoTruncate a column based on a year
Dear, I'd like to truncate my date colum as function of the year. Namely, i'd like to return a column but with the only date in 2024. Here below the expected results: I'm waiting (refresh...
- 2 years ago
Hi,
You will need to create a calculated column
New StartDate =VAR _Year=YEAR(TODAY())RETURN SWITCH(TRUE(), YEAR('Fact'[StartDate])=_Year,'Fact'[StartDate],BLANK())You can replace the variable _Year with any condition or static value.If you would like to display only date of that year, you can filter out the date when is blank in Filter pane as well.
Regards,
Kaviraj11
Solution Sage
2 years agoHi,
You will need to create a calculated column
New StartDate =
VAR _Year=YEAR(TODAY())
RETURN SWITCH(TRUE(), YEAR('Fact'[StartDate])=_Year,'Fact'[StartDate],BLANK())
You can replace the variable _Year with any condition or static value.
If you would like to display only date of that year, you can filter out the date when is blank in Filter pane as well.
Regards,
Yazid
Helper I
2 years agoThanks a lot !