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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Multiple if statements to a column

Hi everyone

 

 

I am new to power bi, i am confused to create a Column with DAX formula.I have a column with 'F' and 'S'with 1's and 0's and another column with 0,1,2,3,4,5,6 now i have to create a column with b,1,2,3,4,5,6

with logic IF((SUM=1 then 1),IF(AND(Sum=4,F=0 then 4),IF(AND(sum=6,S=0 then 6),IF(F=1 || S=1 then "b")))

How can i achiew this LOGIC using DAX in power bi

 

 

Thanks in advance

Aryan

Status: Delivered
Comments
v-yuezhe-msft
Employee

@aryan,

Create a calculated column using DAX below in your table.

Column = IF(Table1[SUM]=1,"1",IF(AND(Table1[SUM]=4,Table1[F]=0),"4",IF(AND(Table1[SUM]=6,Table1[S]=0),"6",IF(Table1[F]=1||Table1[S]=1,"b"))))

1.PNG

If above DAX doesn't return your expected result, please share sample data of your table here.

Regards,
Lydia

v-yuezhe-msft
Employee
Status changed to: Delivered