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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors