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
prakash11440278
Post Prodigy
Post Prodigy

Urgent help in Comparing cell value using AND Operator

HI All,

 

I need a help in comparing two cell values using AND Opertor in powerbi similar to the below image.

Formula i used in excel is: =AND(B2=B3,A2="MOD",A3="DOV"

 

Capture.PNG

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @prakash11440278,

 

Rows in Power BI are different from them in Excel. So we need to add an index in the Query Editor first. You can check it out in this file.

Column =
VAR currentIndex = [Index]
VAR nextUPN =
    CALCULATE (
        VALUES ( Table1[User Principal Name] ),
        FILTER ( ALL ( 'Table1' ), Table1[Index] = currentIndex + 1 )
    )
VAR nextAN =
    CALCULATE (
        VALUES ( Table1[Application Name] ),
        FILTER ( ALL ( Table1 ), Table1[Index] = currentIndex + 1 )
    )
RETURN
    IF (
        [User Principal Name] = nextUPN
            && [Application Name] = "MOD"
            && nextAN = "DOV",
        TRUE (),
        FALSE ()
    )

Urgent_help_in_Comparing_cell_value_using_AND_Operator

 

 

Best Regards,

Dale

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @prakash11440278,

 

Rows in Power BI are different from them in Excel. So we need to add an index in the Query Editor first. You can check it out in this file.

Column =
VAR currentIndex = [Index]
VAR nextUPN =
    CALCULATE (
        VALUES ( Table1[User Principal Name] ),
        FILTER ( ALL ( 'Table1' ), Table1[Index] = currentIndex + 1 )
    )
VAR nextAN =
    CALCULATE (
        VALUES ( Table1[Application Name] ),
        FILTER ( ALL ( Table1 ), Table1[Index] = currentIndex + 1 )
    )
RETURN
    IF (
        [User Principal Name] = nextUPN
            && [Application Name] = "MOD"
            && nextAN = "DOV",
        TRUE (),
        FALSE ()
    )

Urgent_help_in_Comparing_cell_value_using_AND_Operator

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Prakash,

 

Can't download image, can you please reattach screen shot

 

Thanks

Just uploaded a new image. Please check again, thanks for your help.

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.