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

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

Reply
largetony1210
Regular Visitor

Calculate ignoring a filter

Hi,

 

You probably get this a lot but I'm new to PowerBI and DAX and having some issues with a CALCULATE formula.  It looks like this:

 

CALCULATE(COUNT(Data[id]), FILTER(Data, Data[Year] = YEAR([**LastWeekDate]) && Data[Quarter] = (CEILING(MONTH([**LastWeekDate])/3,1)-1) && Data[DayofQuarter] < [**CurrentDayofQtr])))

 

The formula seems to be accounting for the first two filters, but ignoring the third. completely. 

 

Any suggestions?

 

Thanks.

 

5 REPLIES 5
Hardik
Continued Contributor
Continued Contributor

please share the data sample for the same !

Anonymised sample of dataset shown below.

 

I've double checked my measures and they are fine, and have also tested the filters individually, and the problem seems to be "&& Data[DayofQuarter] < [**CurrentDayofQtr]". For some reason, this will not work in the formula. 

 

 

Capture.PNG

Anonymous
Not applicable

@largetony1210,

What is the data of [**LastWeekDate] and [**CurrentDayofQtr]? Could you please post complete columns of your table that can be copied and pasted?

Regards,

Lydia

 @Anonymous these are both measures.

 

[**LastWeekDate] provides the date of the last day in the last week of my dataset: 

**LastWeekDate = MAX(DATE(YEAR(TODAY()),1,1),DATE(YEAR(TODAY()),1,1)-WEEKDAY(DATE(YEAR(TODAY()),1,1),1)+([**LastWeek]-1)*7+1)+7

 

[**LastWeek] here is a whole number.

 

[**CurrentDayofQtr] is the day number of the above date in the current quarter:

**CurrentDayofQtr = CALCULATE(MIN(Data[DayofQuarter]), FILTER(Data, Data[Year] = YEAR([**LastWeekDate])), FILTER(Data, Data[Month] = MONTH([**LastWeekDate])), FILTER(Data, Data[DayofMonth] = DAY([**LastWeekDate])))

 

Hope this helps.

Anonymous
Not applicable

@largetony1210,

Could you please post all the columns that you have mentioned with sample data for us test? You can paste the data into Excel and share Excel via OneDrive.

Regards,
Lydia

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors