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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
anonymous2967
Regular Visitor

Dax - filter to select month end date even if weekend dates are selected

Iam working on powerbi report that includes a "reporting period" and "period" slicers. reporting period is relative date function 
whereas period has date hierachies in slicer which includes options for quarter,month,weekend date. The data gets filtered based on the slicer selection. I have a requirement where , when I select "last 1 week" option in the slicer, it should automatically filter data for 

last week . the interaction works expected for most visuals . 

however. for some visuals , when a week is selected , I want to filter the data for the corresponding month end date rather than just the selected week.
I'm attaching slicer for reference. Can you help me with solution for this ? 

probably create a measure and use it as visual level filter ?

anonymous2967_0-1743992659587.png

 

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@anonymous2967 Create a measure to determine the month-end date for the selected week:

DAX
SelectedWeekEndDate =
VAR SelectedWeek = MAX('Date'[WeekEndDate])
VAR MonthEndDate = EOMONTH(SelectedWeek, 0)
RETURN MonthEndDate

 

Create a measure to filter data based on the month-end date:

FilteredByMonthEndDate =
CALCULATE(
SUM('YourTable'[YourMeasure]),
FILTER(
'Date',
'Date'[Date] = [SelectedWeekEndDate]
)
)

 

Go to the visual where you want to apply this filter.
Drag the FilteredByMonthEndDate measure to the visual-level filters pane.
Set the filter condition to show data where FilteredByMonthEndDate is not blank.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

v-kpoloju-msft
Community Support
Community Support

Hi @anonymous2967,

Thank you for reaching out to the Microsoft fabric community forum. Thank you @bhanu_gautam., for your inputs on this issue.


After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it

Dax Measure For MonthEnd Filter:

MonthEnd_Filter =

VAR MaxSelectedDate =

    MAX('Sales'[Date]) -- Gets the latest date selected from the slicer



VAR EndOfMonthDate =

    EOMONTH(MaxSelectedDate, 0)  -- Gets end of the month for that selected date



RETURN

    IF (

        MAX('Sales'[Date]) = EndOfMonthDate,

        1,

        0

    )

 

vkpolojumsft_0-1744045872277.png

 

I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

View solution in original post

5 REPLIES 5
v-kpoloju-msft
Community Support
Community Support

Hi @anonymous2967,

Thank you for reaching out to the Microsoft fabric community forum. Thank you @bhanu_gautam., for your inputs on this issue.


After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it

Dax Measure For MonthEnd Filter:

MonthEnd_Filter =

VAR MaxSelectedDate =

    MAX('Sales'[Date]) -- Gets the latest date selected from the slicer



VAR EndOfMonthDate =

    EOMONTH(MaxSelectedDate, 0)  -- Gets end of the month for that selected date



RETURN

    IF (

        MAX('Sales'[Date]) = EndOfMonthDate,

        1,

        0

    )

 

vkpolojumsft_0-1744045872277.png

 

I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi @anonymous2967,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @anonymous2967,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @anonymous2967,


I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.


Thank you.

bhanu_gautam
Super User
Super User

@anonymous2967 Create a measure to determine the month-end date for the selected week:

DAX
SelectedWeekEndDate =
VAR SelectedWeek = MAX('Date'[WeekEndDate])
VAR MonthEndDate = EOMONTH(SelectedWeek, 0)
RETURN MonthEndDate

 

Create a measure to filter data based on the month-end date:

FilteredByMonthEndDate =
CALCULATE(
SUM('YourTable'[YourMeasure]),
FILTER(
'Date',
'Date'[Date] = [SelectedWeekEndDate]
)
)

 

Go to the visual where you want to apply this filter.
Drag the FilteredByMonthEndDate measure to the visual-level filters pane.
Set the filter condition to show data where FilteredByMonthEndDate is not blank.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.