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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Filter Function with OR function returns error

I'm trying to usin FILTER and OR function together as shown below

 

 

countItem = 
CALCULATE(
    DISTINCTCOUNT('Table'[Item_Number]),
    FILTER('Table','Table'[Active_Date] <= DATE(2021,10,18)),
    OR(
        FILTER('Table','Table'[End_Date] > DATE(2021,11,15)),
        'Table'[End_Date] = BLANK()
        )
        )

 

 

I got this error message below

"A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

Please help, thanks in advance

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

HI @Anonymous 

 

Try this:

countItem =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Item_Number] ),
    FILTER (
        FILTER ( 'Table', 'Table'[Active_Date] <= DATE ( 2021, 10, 18 ) ),
        'Table'[End_Date] > DATE ( 2021, 11, 15 )
            || 'Table'[End_Date] = BLANK ()
    )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

HI @Anonymous 

 

Try this:

countItem =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Item_Number] ),
    FILTER (
        FILTER ( 'Table', 'Table'[Active_Date] <= DATE ( 2021, 10, 18 ) ),
        'Table'[End_Date] > DATE ( 2021, 11, 15 )
            || 'Table'[End_Date] = BLANK ()
    )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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