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
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
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.

Top Solution Authors