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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Filter in DAX ignores date slicer

Hi everyone,

 

I created a measure in DAX with the calculate function. It counts all orders but filters the date to be equal to or greater than 20. January. This means that the measure counts all orders between 20 and 30 January. This works fine but inside my report, I have a date slicer where you can slice all days in this current month (1 to 30 January). The problem is that the measure I created ignores the date slicer, so if I use the slicer to see from 1 January to 15 January then it shows the same number as 20 to 30 January. It should instead just show 0. 

How can I fix this? And can anybody help? 🙂
Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try this

 

Orders (After 20 January) = 
CALCULATE(COUNT('Table 1'[Order ID])filter('table 1','Table 1'[Coffee]="Yes"&& 'Table 1'[Created]>=DATE(2020;1;20)))/
CALCULATE(COUNT('Table 1'[Type]);filter('table 1','Table 1'[Type]="Espresso"
&& 'Table 1'[Created]>=DATE(2020;1;20)))

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Share your current calculations. You might be using all on date column

Anonymous
Not applicable

@amitchandak @Anonymous 

 

Orders (After 20 January) = 
CALCULATE(CALCULATE(COUNT('Table 1'[Order ID]);'Table 1'[Coffee]="Yes")/
CALCULATE(COUNT('Table 1'[Type]);'Table 1'[Type]="Espresso");
'Table 1'[Created]>=DATE(2020;1;20))

 

 

Anonymous
Not applicable

Try this

 

Orders (After 20 January) = 
CALCULATE(COUNT('Table 1'[Order ID])filter('table 1','Table 1'[Coffee]="Yes"&& 'Table 1'[Created]>=DATE(2020;1;20)))/
CALCULATE(COUNT('Table 1'[Type]);filter('table 1','Table 1'[Type]="Espresso"
&& 'Table 1'[Created]>=DATE(2020;1;20)))

 

Anonymous
Not applicable

@Anonymous  Amazing!!!!

Anonymous
Not applicable

can you share your measure to see what's the issue?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.