Forum Discussion
Dynamic Date Key
- 4 years ago
Hi Anonymous ,
You can try this method:
The year and month of the date in the table are calculated first:
The year and month of the current date are then calculated:
The difference between the months is then calculated:
Column:
Number = IF ( 'Sample Table'[Table Data Month] < 'Sample Table'[Current Month], 'Sample Table'[Current Month] - 'Sample Table'[Table Data Month] + ( 'Sample Table'[Current Year] - 'Sample Table'[Table Data Year] ) * 12, ( 'Sample Table'[Current Year] - 'Sample Table'[Table Data Year] ) * 12 - ( 'Sample Table'[Table Data Month] - 'Sample Table'[Current Month] ) )Then use the year and month of the data in the table as a filter, use the card visual, introduce the number column, and you can view it:
Is this the result you would expect?
Hope this helps you.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You can try this method:
The year and month of the date in the table are calculated first:
The year and month of the current date are then calculated:
The difference between the months is then calculated:
Column:
Number =
IF (
'Sample Table'[Table Data Month] < 'Sample Table'[Current Month],
'Sample Table'[Current Month] - 'Sample Table'[Table Data Month] + ( 'Sample Table'[Current Year] - 'Sample Table'[Table Data Year] ) * 12,
( 'Sample Table'[Current Year] - 'Sample Table'[Table Data Year] ) * 12 - ( 'Sample Table'[Table Data Month] - 'Sample Table'[Current Month] )
)
Then use the year and month of the data in the table as a filter, use the card visual, introduce the number column, and you can view it:
Is this the result you would expect?
Hope this helps you.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.