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
MartySapp
Frequent Visitor

Slicer being ignored on filter

Hi,

 

i have the following code

Working Capital user date = VAR NetSales = CALCULATE([Running Total all time], all(Header),Header[Header] ="Revenue",  all('2022&2023'),'2022&2023'[Period Lookup.StartDate] > SELECTEDVALUE('2022&2023'[Period Lookup.StartDate]) && '2022&2023'[Period Lookup.StartDate] < DATE (2023,01,01)) --End Date
    VAR TotalWC = CALCULATE([Magic Additive Total bs -Ratios]/1000)
    VAR Result = DIVIDE(TotalWC  , NetSales)
    return Netsales
the start date is picked from the slicer but the All filter on the calc is ignoreing it, if i manualy code the dates in like below then i get the result i want , any ideas?
 
Working Capital = VAR NetSales = CALCULATE([Running Total all time], all(Header),Header[Header] ="Revenue", all('2022&2023'),'2022&2023'[Period Lookup.StartDate] > DATE(2022,02,01) && '2022&2023'[Period Lookup.StartDate] < DATE(2023,03,01))
    VAR TotalWC = CALCULATE([Magic Additive Total bs -Ratios]/1000)
    VAR Result = DIVIDE(TotalWC  , NetSales)
    return Netsales
2 REPLIES 2
amitchandak
Super User
Super User

@MartySapp , all('2022&2023') is causing that , You should use date table in such cases

 

refer these examples

 

CALCULATE([Running Total all time], all(Header),Header[Header] ="Revenue", filter(2022&2023','2022&2023'[Period Lookup.StartDate] > Max('Date'[Date]) && '2022&2023'[Period Lookup.StartDate] < DATE (2023,01,01)))

 

Here date table can be an independent date table

https://youtu.be/UoDPMF0nh3Q

 


To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

 

 

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

 

Thanks i thought "all" would be causing problems.

 

i have a spereate "Calander" Table with a Date , now im getting Blank as answer regradless of what date i pick as start date for the range 

 

VAR NetSales = CALCULATE([Running Total all time], all(Header),Header[Header] ="Revenue",  Filter('2022&2023','2022&2023'[Period Lookup.StartDate] > MAX ('Calendar'[Date]) && '2022&2023'[Period Lookup.StartDate] < DATE (2023,01,01)))
    VAR TotalWC = CALCULATE([Magic Additive Total bs -Ratios]/1000)
    VAR Result = DIVIDE(TotalWC  , NetSales)
    return Netsales

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