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

Create a Rolling Month Filter given a date filter

I have a graph that plots revenue. I need a filter that filters the dates on the graph to show only the current month depending on the selected date. The graph should be a rolling month.

 

If the selected date is March 10, the graph should show March 1-10.

If the selected date is Febraury 28, the graph should show February 1-28.

If the selected date is February 5, the graph should show February 1-5.

 

This is my calculation for the last sale date given the selected date:

TS_LASTSALESDATE2 = CALCULATETABLE ( LASTNONBLANK ( DimDate[DateKey], 0), ALLSELECTED(FactSales))
 
This is my attempt at a filter that didn't work:
Filtered Month = IF(FORMAT(LASTNONBLANK(DimDate[DateKey],0),"YYYYMM")=FORMAT([TS_LASTSALESDATE2],"YYYYMM"),"YES","NO")
 
Appreciate the help!
2 REPLIES 2
amitchandak
Super User
Super User

@cbolling , with help from a  date table use datesmtd

 

example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

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

Hi @amitchandak ,

 

I do not want to display MTD sales, I want to display sales of each day in the month, but the X axis is the day of the month, and next week on the first day it would jump back to 1.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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