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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.