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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
rpinxt
Power Participant
Power Participant

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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
Most Valuable Professional
Most Valuable Professional

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
Power Participant
Power Participant

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.