Forum Discussion
Nischal
Helper I
8 years agoDAX TOTALYTD() - Duplicate Date Error
not able to visualize the YTD sales ... so what is wrong in the dax Total Sales YTD = TOTALYTD(sales_attributes1[Total Sales],sales_attributes1[DATECREATED] ) the calculation error in sales[t...
ElliotP
Post Prodigy
8 years agoEvening,
In tabular data models (power bi, tables & relationships) it's best to create a related date table to your fact table.
Your fact table typically contains all of your data, for example transaction log.
Your Date table is a representation of dates and the associated valeus as so you can filter against and use the columns in place of dates values from your fact table.
Here is a great template of a date table (https://www.sqlbi.com/articles/reference-date-table-in-dax-and-power-bi/); you can also google about for some simple Power Query to build you a super basic date table. Once you've added that in, join your fact and new date table with a relationship by the Date column in your fact table and the DateKey in the date table.