sql-bi / DaxDateTemplate

Power BI template to create a Date table in DAX
MIT License
265 stars 76 forks source link

PowerBI template error for Fiscal Year #28

Closed amr0810 closed 4 years ago

amr0810 commented 4 years ago

I am new to DAX and PowerBI and already like it. I am trying to use the template but an error keeps poping up regarding fiscal Periods. A line in the code has two parameters FW StarOfYear and FW EndOfYear, I have tried to manually filling with custom dates '2019-04-01' and '2020-3-31' but I get an error: "Column in Table '' contains a duplicate value '4/1/2019' and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table." Any ideas what is wrong ?

marcosqlbi commented 4 years ago

You should only change the variables assigned in the Configuration section, those columns are computed based on the content of the first section, indeed. I suggest you to read the comments in the configuration section and to analyze the differences obtained by modifying those. In particular, you just need FiscalCalendarFirstMonth and also read this article: https://www.sqlbi.com/articles/reference-date-table-in-dax-and-power-bi/