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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
pramita
Helper II
Helper II

Multiple OR

This is my code, I want to find out the number of fewer than 4 ratings an employee has given for specific questions. I would like to know where I'm going wrong.
 
DI JR = DIVIDE(CALCULATE(
COUNTROWS(INPUT),
'INPUT'[Level] = "JR",
OR(
OR(
OR(
OUTPUT[Q1] < 4,
OUTPUT[Q5] < 4
),
OR(
OUTPUT[Q7] < 4,
OUTPUT[Q8] < 4
)
),
OUTPUT[Q11] < 4),
),
DISTINCTCOUNT(OUTPUT[Email Address]))
 
It gives an error saying "Argument '4' in CALCULATE function is required."
Any feedback is welcome. Thanks. 
4 ACCEPTED SOLUTIONS
musicbydannyd
Advocate IV
Advocate IV

@pramita, instead of "OR", try "||" instead. Good luck.

View solution in original post

ryan_mayu
Super User
Super User

@pramita 

Just like what @musicbydannyd suggested, OR can only add two conditions,e.g OR(OR(condition1,condition2),condition3.

However || can add more than 2 conditions, e.g. condition1 || condition2 || condition3 ||....||condition N.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

amitchandak
Super User
Super User

@pramita , try like

DI JR = DIVIDE(CALCULATE(
COUNTROWS('INPUT'),filter('INPUT',
'INPUT'[Level] = "JR",
OR(
OR(
OR(
OUTPUT[Q1] < 4,
OUTPUT[Q5] < 4
),
OR(
OUTPUT[Q7] < 4,
OUTPUT[Q8] < 4
)
),
OUTPUT[Q11] < 4)
)),
DISTINCTCOUNT(OUTPUT[Email Address]))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-juanli-msft
Community Support
Community Support

Hi @pramita 

Try below:

DI JR =
DIVIDE (
    CALCULATE (
        COUNTROWS ( INPUT ),
        VALUES ( 'INPUT'[Level] ) = "JR",
        FILTER (
            OUTPUT,
            OR (
                OR (
                    OR ( OUTPUT[Q1] < 4, OUTPUT[Q5] < 4 ),
                    OR ( OUTPUT[Q7] < 4, OUTPUT[Q8] < 4 )
                ),
                OUTPUT[Q11] < 4
            )
        )
    ),
    DISTINCTCOUNT ( OUTPUT[Email Address] )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @pramita 

Try below:

DI JR =
DIVIDE (
    CALCULATE (
        COUNTROWS ( INPUT ),
        VALUES ( 'INPUT'[Level] ) = "JR",
        FILTER (
            OUTPUT,
            OR (
                OR (
                    OR ( OUTPUT[Q1] < 4, OUTPUT[Q5] < 4 ),
                    OR ( OUTPUT[Q7] < 4, OUTPUT[Q8] < 4 )
                ),
                OUTPUT[Q11] < 4
            )
        )
    ),
    DISTINCTCOUNT ( OUTPUT[Email Address] )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@pramita , try like

DI JR = DIVIDE(CALCULATE(
COUNTROWS('INPUT'),filter('INPUT',
'INPUT'[Level] = "JR",
OR(
OR(
OR(
OUTPUT[Q1] < 4,
OUTPUT[Q5] < 4
),
OR(
OUTPUT[Q7] < 4,
OUTPUT[Q8] < 4
)
),
OUTPUT[Q11] < 4)
)),
DISTINCTCOUNT(OUTPUT[Email Address]))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
ryan_mayu
Super User
Super User

@pramita 

Just like what @musicbydannyd suggested, OR can only add two conditions,e.g OR(OR(condition1,condition2),condition3.

However || can add more than 2 conditions, e.g. condition1 || condition2 || condition3 ||....||condition N.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




musicbydannyd
Advocate IV
Advocate IV

@pramita, instead of "OR", try "||" instead. Good luck.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.