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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mds123
Frequent Visitor

How can I show next month's orders when filtering to the current month?

I have a page where the user filters to the current month and one of the visuals should show the next months orders. The other visuals on the page show the current month.

 

I tried removing the slicer from the Next Month visual but then it just shows every month's data. 

 

I have an order table and a date table.

1 ACCEPTED SOLUTION
v-tianyich-msft
Community Support
Community Support

Hi @mds123 ,

 

Not sure about your data model, I made simple samples and you can check the results below:

vtianyichmsft_0-1708481507295.png

Current = var _s =SELECTEDVALUE('Table'[Date].[MonthNo])
var _s2 = SELECTEDVALUE('Table'[Date].[Year])
RETURN CALCULATE(SUM('Order'[Value]),FILTER('Order',[Date].[Year]=_s2&&[Date].[MonthNo]=_s))

Next = var _s =SELECTEDVALUE('Table'[Date].[MonthNo])+1
var _s2 = SELECTEDVALUE('Table'[Date].[Year])
RETURN CALCULATE(SUM('Order'[Value]),FILTER('Order',[Date].[Year]=_s2&&[Date].[MonthNo]=_s))

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-tianyich-msft
Community Support
Community Support

Hi @mds123 ,

 

Not sure about your data model, I made simple samples and you can check the results below:

vtianyichmsft_0-1708481507295.png

Current = var _s =SELECTEDVALUE('Table'[Date].[MonthNo])
var _s2 = SELECTEDVALUE('Table'[Date].[Year])
RETURN CALCULATE(SUM('Order'[Value]),FILTER('Order',[Date].[Year]=_s2&&[Date].[MonthNo]=_s))

Next = var _s =SELECTEDVALUE('Table'[Date].[MonthNo])+1
var _s2 = SELECTEDVALUE('Table'[Date].[Year])
RETURN CALCULATE(SUM('Order'[Value]),FILTER('Order',[Date].[Year]=_s2&&[Date].[MonthNo]=_s))

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

DataInsights
Super User
Super User

@mds123,

 

This can be achieved with Time Intelligence functions. Example measure:

 

Next Month Orders =
CALCULATE ( SUM ( Orders[Amount] ), DATEADD ( Dates[Date], 1, MONTH ) )

 





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

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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