Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 choose from 6/1 to 6/24 it works okay
please see below
but now after i change the slicer to go back just one day :
i think the power bi treat 6/25 and the end of month
why this BUG is happening???!!
Solved! Go to Solution.
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:
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.
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:
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.
Oh My gosh, i spent days try to figure out what's going on, as you said the mistake was in M Query itself,
i created a DimDate in depends on the fact table with Min date and Max date there i avoid dates with blank in my report so user with never find a month date for example with no data,
it appears that M query treat MAx Date of Fact table as today() which it's so stupid,
to avoid this i first used
Date.EndOfYear(#"Calculated Earliest") but it return the whole year, then i used
= Date.AddDays(List.Max(#"Removed Other Columns"[order_date]), 1)
just to add one more day after last date of data so it doesn't treat it as today() 🤣🤣
i think this is stilll a bug 🤣🤣
thanks you so much sir.
Either today or max of fact date will not have complete month for the last month. It is not a bug. If you supply the complete dates available in the date table for a particular month (example Jun 1 to June 25 are all the dates of the month June available in the date table) then DATEADD treats it as complete month and return a complete month as an output. Again it could be stupid but it's not a bug.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |