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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.