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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
kristi_in_heels
Helper II
Helper II

Help with Relative Dates & Measure for 2 Months Time excluding next month

Hello,

 

I am trying to create a visual using cards, which will return 3 separate values for this month, next month, and the month after that.

 

Using relative dates works for this month and next month, but selecting "in 2 calendar months" tallies the total of both months. I am looking to separate the month on its own.

 

For example, 

 

* Current Month (eg Nov 2023)- I am using relative date "in this month"

* Next Month (Current month + 1: Dec 2023) - I am using relative date "in the next 1 calendar months"

* Next Month +2 (Jan 2024) - How do I capture this month on its own?

 

For reference, I am using the following measure to calculate the total values and this works well with the relative date filters also:

 

CPS Monthly =
CALCULATE(
    SUM('Finance Look Ahead Tabulated'[Value]),
    USERELATIONSHIP('Calendar'[Date], 'Finance Look Ahead Tabulated'[Date]))
 
Any assistance is appreciated.

 

 

1 ACCEPTED SOLUTION
kristi_in_heels
Helper II
Helper II

I have managed to use your format to create a measure which is working for +2 Months, thank you for your help.

 

CPS This Month +2 =
var _min = eomonth(today(),0)+2
var _max = eomonth(today(),2)
return CALCULATE([CPS Monthly], FILTER('Calendar','Calendar'[Date] >=_min && 'Calendar'[Date] <= _max))

View solution in original post

3 REPLIES 3
kristi_in_heels
Helper II
Helper II

I have managed to use your format to create a measure which is working for +2 Months, thank you for your help.

 

CPS This Month +2 =
var _min = eomonth(today(),0)+2
var _max = eomonth(today(),2)
return CALCULATE([CPS Monthly], FILTER('Calendar','Calendar'[Date] >=_min && 'Calendar'[Date] <= _max))
amitchandak
Super User
Super User

@kristi_in_heels , if you want without filter

 

This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

Last Month Today =
var _min = eomonth(today(),-2)+1
var _max = eomonth(today(),-1)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

Next Month Today =
var _min = eomonth(today(),0)+1
var _max = eomonth(today(),1)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

use all(Date) to igonre filter

This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE([Net], FILTER(all('Date') ,'Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

With the filter of slicer, you can use measures like

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))

 

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, I can't see where the today + 2 months measure comes in?

 

Essentially I need something that will return the total of every value for January 2024 if I run the numbers today (Nov-2023)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.