Forum Discussion
YTD line chart
- 9 years ago
Hi mbegg
I would suggest creating a YTD measure where you use a Date Table also. This will ensure that you can then get the right values for your measures.
YTD = TOTALYTD(sum('TableName'[ColumnName]),'Date'[Calendar Date],ALL('Date'),"06/30")And here is a blog post around why you need a date table and how to create one.
- 9 years ago
Hi mbegg,
As GilbertQ mentioned above, an individual Calendar table is needed in this case. You can use CALENDARAUTO function to create it, and then create a relationship between your fact table and this Date table with the date column.
Date = CALENDARAUTO()
And the formula below is for the new YTD measure using Date[Date] column.
Value_YTD_Fis = IF( ISFILTERED('Date'[Date]), ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy"), TOTALYTD(SUM('Sheet1'[Value]), 'Date'[Date],"30/6") )Here is the modified pbix file for your reference. :smileyhappy:
Regards
Hi mbegg,
As GilbertQ mentioned above, an individual Calendar table is needed in this case. You can use CALENDARAUTO function to create it, and then create a relationship between your fact table and this Date table with the date column.
Date = CALENDARAUTO()
And the formula below is for the new YTD measure using Date[Date] column.
Value_YTD_Fis =
IF(
ISFILTERED('Date'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy"),
TOTALYTD(SUM('Sheet1'[Value]), 'Date'[Date],"30/6")
)
Here is the modified pbix file for your reference. :smileyhappy:
Regards