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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Get next month data based on selected month

Hi Guys,

In my report the requirement is I need to get sum of weeks based on selected month but the twist is I need to get next month sum of weeks. 
for e.g. If user selected May from Month filter it needs to show data for Jun and if user select Jun in month filter it needs to show July data etc.

Below is my DAX 

Selected Month + 1 =
VAR _Date1 = DATE(SELECTEDVALUE('Date'[Year]),SELECTEDVALUE('Date'[MonthOfYear])+ 1,1)
VAR _Date2 = DATE(SELECTEDVALUE('Date'[Year]),SELECTEDVALUE('Date'[MonthOfYear])+ 1,27)
RETURN
CALCULATE(
SUMX(ListingDelays_Response_UpdatedListingDelays_Response_Updated[Number of weeks]),
ListingDelays_Response_Updated[EnteredDate] >= _Date1 &&
ListingDelays_Response_Updated[EnteredDate] <= _Date2 )
 
Now if I remove +1 from SELECTEDVALUE('Date'[MonthOfYear])+ 1 it is showing data of selected month but no result are shown with + 1. I checked the VAR is seperate measure it is showing correct dates.
 
Any suggestion what I doing wrong and how to acheive above?
 
Thanks 
 
1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

The first thing to note is you'll have a problem if the user selects December.  Your logic to add 1 to the month number (MonthOfYear) will give you month 13.

DAX has a function called DATEADD which is commonly used in scenarios like this.

Something like:

SelectedMonth + 1 = 
CALCULATE(
    SUM(ListingDelays_Response_Updated[Number of weeks]),
    DATEADD('Date', 1, MONTH)
    )

 

View solution in original post

2 REPLIES 2
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

The first thing to note is you'll have a problem if the user selects December.  Your logic to add 1 to the month number (MonthOfYear) will give you month 13.

DAX has a function called DATEADD which is commonly used in scenarios like this.

Something like:

SelectedMonth + 1 = 
CALCULATE(
    SUM(ListingDelays_Response_Updated[Number of weeks]),
    DATEADD('Date', 1, MONTH)
    )

 

Anonymous
Not applicable

Hi PaulOlding,

 

Thanks for this, DateADD actually really helped. 

Best Regards,

Thanks



 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.