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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.