Forum Discussion
Anonymous
2 years agoNot applicable
Need Help with YTD Function
I am trying to plot a line chart using monthly revenue on Y-axis and Month on X-axis. I created a measure for the monthly revenue MonthlyRevenue = TOTALMTD( [Revenue], 'Order Date'[Da...
parry2k
2 years agoSuper User
Anonymous
As a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools. Check the related videos on my YT channel
Add Date Dimension
Importance of Date Dimension
Time Intelligence Playlist
After adding a date table, add this measure:
Last 12 Month from Today =
VAR __Today = EOMONTH ( TODAY (), 0 )
RETURN
CALCULATE (
[Revenue],
KEEPFILTERS ( DATESINPERIOD ( 'Date Table'[Date], __Today, -12, MONTH ) )
)
Use above measure on y-axis and month/year columns from date table.