'PowerBi - get page filter paramenter - month in DAX

I'm trying to build a report that shows product requests and in addition requests that were closed in the current month. Closed requests consist of requests placed last month and finished in the current month (two column filter) and requests placed this month and closed this month.

Problem is - I have a page filter of date that filters requests created in the selected date range.

I have written this DAX:

ClosedInCurrMonth = CALCULATE(COUNT(requests[request_id]),
                    FILTER(ALL(requests), 
                           requests[order_date].[MonthNo] = 1 &&
                           requests[close_date].[MonthNo] = 2))

With this code I override current date selection and get number of requests that were registered in January and closed in February. But I want to make it dynamic. Instead of 1 & 2 and I would like to get month number from the Page Filter which is done on Date table that is connected to requests[order_date]

Any suggestions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source