Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
rpinxt
Impactful Individual
Impactful Individual

Relative Date issues

I am filtering to see last 13 months:

rpinxt_0-1698132576861.png

I can see the dates but why does it do this?

Its Oct 23 now sow 13 months I would expect Sep 22 to Oct 23. So full months.

 

But I don't get full months:

Filtered

rpinxt_1-1698132667313.png

Without filter:

rpinxt_2-1698132686320.png

 

So relative date will not work to get full months? Only at the end of month october 23?

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @rpinxt ,

 

The last x months relativie date filter  is relative to the current day and does not include full months. The last x calendar months does  include the full months but not if the current month if it isn't complete yet. You can create a calculated column to calculate the for the number of months  from today, the current month being month 1 and the previous month being month 2, etc. Here's a sample formula:

Rolling Months from Today = 
DATEDIFF ( Dates[Date], TODAY (), MONTH ) + 1

danextian_0-1698137050531.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
Villezekeviking
Helper II
Helper II

I now this is already solved but I'm offering an alternative solution for those who might search and find this thread.

 

https://www.villezekeviking.com/dax-tables-calendar-and-time/

 

I have offset-columns from today that can be used to filter any report relative from today on days, weeks, months, quarters or years.

Unlike the relative date filtering, this can span any period, from historical data, over current periods and into the future.

 

You can use this in your scenario to filter on months to get full calendar months.

-1 is prev month, -2 the month before that etc.

rpinxt
Impactful Individual
Impactful Individual

Thanks @danextian !

Was able to add this rolling month field into my autocalendar and now can use it to filter the page.

Now I get Oct 23 to Sep 22 (full month) 😄

danextian
Super User
Super User

Hi @rpinxt ,

 

The last x months relativie date filter  is relative to the current day and does not include full months. The last x calendar months does  include the full months but not if the current month if it isn't complete yet. You can create a calculated column to calculate the for the number of months  from today, the current month being month 1 and the previous month being month 2, etc. Here's a sample formula:

Rolling Months from Today = 
DATEDIFF ( Dates[Date], TODAY (), MONTH ) + 1

danextian_0-1698137050531.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.