Forum Discussion

prakash11440278's avatar
prakash11440278
Post Prodigy
8 years ago
Solved

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"    
  • v-jiascu-msft's avatar
    8 years ago

    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