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
micahelw
Regular Visitor

Confusion with Filter / Context

Hi

 

I am confused with some results using an explicit filter rather than an implicit filter.

 

I have one fact table (ASB cases) and a Date table.  The two tables have an active relationship between Calendar[Date] and ASB[Reported date].

 

I need a measure based on a Call Due date, where the call is made on time so am using USERELATIONSHIP.

 

I have got the measure working based on the following.

Initial Response on Time =
        CALCULATE(COUNTROWS('ASB Case'),
        USERELATIONSHIP('ASB Case'[Call Due to Reporting Party], 'Calendar'[Date]),
        'ASB Case'[Contacted Reporting Party On Time?] = "On-Time"
)
 
My initial Dax which returned incorrect results was
 
Broken Initial Response on Time =
    CALCULATE(COUNTROWS('ASB Case'),
    USERELATIONSHIP('ASB Case'[Call Due to Reporting Party], 'Calendar'[Date]),
    FILTER('ASB Case','ASB Case'[Contacted Reporting Party On Time?] = "On-Time"))
 
micahelw_0-1675373719547.png

Clearly the way the filter is being used is wrong, but I can't really see the difference.  I know Filter removes existing related filters first - so if anything was to happen I would have expected to see even more cases?  

 

If anyone can help I'd be really grateful.  I'd also welcome any advice on steps I could take to debug the issue.

 

Many thanks in advanve

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @micahelw 

the syntax suger is equivalent to

 

FILTER(ALL('ASB Case'[Contacted Reporting Party On Time?],'ASB Case'[Contacted Reporting Party On Time?] = "On-Time"))

 

rather 

 

FILTER('ASB Case','ASB Case'[Contacted Reporting Party On Time?] = "On-Time"))

 

without the ALL, the table is always filtered by the year/row of the matrix.

 

View solution in original post

1 REPLY 1
FreemanZ
Super User
Super User

hi @micahelw 

the syntax suger is equivalent to

 

FILTER(ALL('ASB Case'[Contacted Reporting Party On Time?],'ASB Case'[Contacted Reporting Party On Time?] = "On-Time"))

 

rather 

 

FILTER('ASB Case','ASB Case'[Contacted Reporting Party On Time?] = "On-Time"))

 

without the ALL, the table is always filtered by the year/row of the matrix.

 

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.

Top Solution Authors