Forum Discussion
thimremy
9 years agoFrequent Visitor
TOTALYTD DAX function doesn't work
Hello, I'm following Power BI tuto and good news, I'm already stuck at the TOTALYTD DAX function. Here is an extract of the test table (Excel) I created (and I generated around 700 lines): ...
- 9 years agoHi @ thimremy,
Since you are using a date column in the same table as the sales data when you use the month column the calculation will be made month on month and not based on the YTD measure you nwed to add the date column to your table and select the hierarchy and theb the month that qay you will have the YTD calculation.
One good practice for this kind of calculation is to create a calendar table with non repetive dates and with month, year, quarter,... columns and then create a relationship between the calendar and the Sales date then use the columns in the calendar to make the axis/main columns in your visuals that way the measures will work ad expectef.
Regards,
MFelix
MFelix
9 years agoSuper User
Hi @ thimremy,
Since you are using a date column in the same table as the sales data when you use the month column the calculation will be made month on month and not based on the YTD measure you nwed to add the date column to your table and select the hierarchy and theb the month that qay you will have the YTD calculation.
One good practice for this kind of calculation is to create a calendar table with non repetive dates and with month, year, quarter,... columns and then create a relationship between the calendar and the Sales date then use the columns in the calendar to make the axis/main columns in your visuals that way the measures will work ad expectef.
Regards,
MFelix
Since you are using a date column in the same table as the sales data when you use the month column the calculation will be made month on month and not based on the YTD measure you nwed to add the date column to your table and select the hierarchy and theb the month that qay you will have the YTD calculation.
One good practice for this kind of calculation is to create a calendar table with non repetive dates and with month, year, quarter,... columns and then create a relationship between the calendar and the Sales date then use the columns in the calendar to make the axis/main columns in your visuals that way the measures will work ad expectef.
Regards,
MFelix