Forum Discussion

Amrselim1989's avatar
Amrselim1989
Icon for Helper II rankHelper II
3 years ago
Solved

BUG in Power bi

Dear friends,  i beleive there is a bug in power bi DATEADD(DimDate[Date],-1,MONTH) it works in a very strange way, if i choose from 6/1 to 6/25 it returns the whole month of May, but if i just ch...
  • tamerj1's avatar
    3 years ago

    Hi Amrselim1989 
    It is not a bug, they just have designed it this way 😄

    This is what the documentation says, and I quote:
    "The result table has an entire month if an entire month is selected in the source table. The notion of “month selected” is based on the dates available in the underlying date table. This way:

    • If the <Dates> argument includes all the days in April (30 rows), the result for the previous month includes all the days in March (31 days).
    • If the <Dates> argument includes the first 15 days in April (15 rows), the result for the previous month includes the first 15 days in March (15 rows)."

    Seems that the last date in your date table is TODAY ( ), therefore, it considers that complete month is included in the source table and thus returning the complete previous month. It is always recommended when using time intelligence functions, to include the complete dates of the years (from Jun 1st to Dec 31st) in order to avoid falling in such errors.

     

    In my opinion, time intelligence functions are not user friendly as they were supposed to be and I personally don't use them.