Forum Discussion

subhashg's avatar
subhashg
Frequent Visitor
3 years ago
Solved

DatesInPeriod with duplicate dates in fact table Unique in Calender table

Unable to get 3M rolling sum using datesInPeriod inspite of calender marked as date table. I have 2 tables. Fact table(Table)- Duplicate date keys, Calender table - Unique keys & marked as date ta...
  • DataNinja777's avatar
    3 years ago

    Hi subhashg ,

     

    The reason it is showing incorrect figures is because the formula is referencing the fact table date column instead of the calendar table.   It is recommended that we always use fields from a dimension table in our visualization instead of the fact table in order to avoid unintentional issues like this.  Modifying your dax formula to reference the calendar table date instead of the fact table date produces the following output for datesbetween.  

    Also, for datesinperiod, the same output was produced.

    I attach the pbix file for your reference:

    DatesInPeriod task.pbix