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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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