Forum Discussion
Creating a Current Month Column in a Report
- 4 years ago
Hi Anonymous ,
Maybe you can try this expression:
Column = VAR _DIFF = DATEDIFF ( DATE ( 2000 + VALUE ( RIGHT ( [READY_DATE], 2 ) ), VALUE ( LEFT ( [READY_DATE], 2 ) ), 1 ), TODAY (), MONTH ) RETURN IF ( _DIFF > 12, 0, _DIFF )Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello! croberts21
So I manually input a column to help specify the month and year of a record in the table. Example: "0522" occurred in May of 2022. However, "0100" does not have a date to it. I was looking to create a dynamic column to help signifiy the most recent month we have in the table. So "0522" would ideally be 1 or -1, and the month before that be -2 or 2. And so on and so fourth
Hi Anonymous ,
Maybe you can try this expression:
Column =
VAR _DIFF =
DATEDIFF (
DATE ( 2000 + VALUE ( RIGHT ( [READY_DATE], 2 ) ), VALUE ( LEFT ( [READY_DATE], 2 ) ), 1 ),
TODAY (),
MONTH
)
RETURN
IF ( _DIFF > 12, 0, _DIFF )
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
This was exactly what I was looking for! Thank you for the advice!