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
bboobe
Helper I
Helper I

NEED HELP - Create a Measure/DAX for Date Filter

Hi Experts, 

 

My Dataset refreshes incrementally everyday. For Current Month, I have Day wise data and for past months - end of months data.  

i.e, At the begining of Next month, current months data will be as of end of month's only. 

 

i need to apply filter -- Past Months should be slected. For Current Month, only latest day should be selected. Without manual intervention, this should continue. Please advise if this can be done. 

 

Thanks.

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Probably. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@bboobe , refer if these can help

https://www.youtube.com/watch?v=lkHFpmA4SJ4
https://www.youtube.com/watch?v=JrwFLfUFaxk

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

@amitchandak  it did not.  I already have a measure to see if the date is the latest date of current month.. but the issue is, i need to include past months as well in the filter. 

present drawback - When the current month ends, the next month's dates will become "latest date" according to my formula and the last month wont be included in the filter  

@bboobe , Relative date slicer, Before option in Date slicer are the one that can be used at the page level and you can have a slicer to control thing further

Like The column and its sort column. This can be used as slicer

Month Name =
var _mm= datediff([date],eomonth(today(),0),month)
return
switch( true(),
_mm =0, "Current Month",
_mm =1, "Last Month",
format([Date],"MMM-YYYY")
)

Month year Sort = format([Date],"YYYYMM")

 

 

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

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.

Top Solution Authors
Top Kudoed Authors