Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Mutiple Else IF

I got stuck. How to implement the formula below in Power BI?

 

if [Current Week]=[Last Week] then "NO1"
elseif [Current Week]<[Last Week] then "P1"
elseif [Current Week]>[Last Week] then "P2"
elseif ISNULL([Last Week]) then "NE"
else ""
END

 

 

  • Anonymous 

    You are adding a column I suppose: use the code below:

    Column Name= 
    
    SWITCH(
        TRUE(),
     [Current Week]=[Last Week] , "NO1",
     [Current Week]<[Last Week] , "P1",
     [Current Week]>[Last Week] , "P2",
     ISBLANK([Last Week]) , "NE"
    )



1 Reply

  • Anonymous 

    You are adding a column I suppose: use the code below:

    Column Name= 
    
    SWITCH(
        TRUE(),
     [Current Week]=[Last Week] , "NO1",
     [Current Week]<[Last Week] , "P1",
     [Current Week]>[Last Week] , "P2",
     ISBLANK([Last Week]) , "NE"
    )