Forum Discussion
Issue with TotalYTD and Sameperiodelastyear
- 8 years ago
That solved the problem. I now get the values I want.
Thank you.
The set-up is now as follows:
Totalsalg YTD = TOTALYTD([Totalsalg];DATESYTD(Dates[Date]))
Totalsalg LYTD = CALCULATE([Totalsalg YTD];SAMEPERIODLASTYEAR('Dates'[Date]))
And I needed something to filter the year. Both a slicer that selects year or a matrix with year as rows works and gives me the YTD values. When adding a slicer that select Month of Year to-from I also get the eyar to date values from previous years.
I changed the YTD measure to:
TotalSales YTD = TOTALYTD([TotalSales];Dates[Date])
This causes the table showing the values to go from:
To this:
I get no error messages.
hi misano, I can't see the whole matrix in the screenshot but have you tried adding the 'year' column from your dates table?
- gooranga18 years ago
Power Participant
Just create a calculated column in the dates table ;
Year = year(Dates[Date])
I think somewhere you can create a date dimension table with all the columns you might require.
http://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns
https://www.mssqltips.com/sqlservertip/4857/creating-a-date-dimension-table-in-power-bi/
- sokg8 years ago
Solution Supplier
Your calendar table is a date/time not a date
You have to convert both dates in calendar and sales to date
Then try to create a decent calendar table with the instructions showed above.