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
magnifybi
Resolver I
Resolver I

How to make formula ignore date slicers

If I change the date slicers to full year 2020, or first 6 months it works, but if I change it to July for instance, the measure goes blank, any idea why? Is it because I'm filtering out the data for it to calculate?

 

Quantity Last Week =
Var thisweek = WEEKNUM(today())
Var amount = calculate(Transactions[Quantity Total],vw_DateDim[WeekOfYear]=thisweek-1)
Return amount
 
Any way to ignore the date slicers?
1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

Your formula only changes the filter on the single [weekofyear] column while retaining any filters on every other calendar column. If you want to modify the entire cal table, you need to change the formula to first remove the filter on the entire table. 

 

Quantity Last Week =
Var thisweek = WEEKNUM(today())
Var amount = calculate(Transactions[Quantity Total],filter(all(vw_DateDim),vw_DateDim[WeekOfYear]=thisweek-1))
Return amount


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

Your formula only changes the filter on the single [weekofyear] column while retaining any filters on every other calendar column. If you want to modify the entire cal table, you need to change the formula to first remove the filter on the entire table. 

 

Quantity Last Week =
Var thisweek = WEEKNUM(today())
Var amount = calculate(Transactions[Quantity Total],filter(all(vw_DateDim),vw_DateDim[WeekOfYear]=thisweek-1))
Return amount


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks Matt, very helpful

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.