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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
MoiraBannister
Regular Visitor

PowerBI

Good morning, still a novice with PowerBI but loving it - need some guidance

Is it possible to have 2 arguments in a conditional column - i.e. if the device type is laptop and the age is 5 = fully depreciated and if the device type is desktop and the age is 6 = fully depreciated
 
1 ACCEPTED SOLUTION

Hi @MoiraBannister ,

 

To create a custom column in power query. We can use the formula as below.

 

if [type] = "laptop" and [age] = 5 then "fully depreciated" else if [type]="desktop" and [age]=6 then "fully depreciated" else "else"

cust.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

7 REPLIES 7
v-frfei-msft
Community Support
Community Support

Hi @MoiraBannister ,

 

One sample for your reference. Here I create a calculated column as below.

Column =
IF (
    AND ( Table1[type] = "laptop", Table1[age] = 5 ),
    "fully depreciated",
    IF (
        AND ( Table1[type] = "desktop", Table1[age] = 6 ),
        "fully depreciated",
        "else"
    )
)

 

Capture.PNG

 

Pbix as attached.

 

Regards.

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thanks so much, I am very grateful for the assistance - this is the erro I get

Capture.PNG

Hi @MoiraBannister ,

 

To create a custom column in power query. We can use the formula as below.

 

if [type] = "laptop" and [age] = 5 then "fully depreciated" else if [type]="desktop" and [age]=6 then "fully depreciated" else "else"

cust.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thank you so much, greatly appreciated

Anonymous
Not applicable

You can simply use the option to add a conditional column in the 'add column' tab (query editor). While using this option you can add lines per condition. 

 

Power BI will write the coding for you using this option.

 

Hope this is helpfull!

 

Regards

Anonymous
Not applicable

Hi MoiraBannister,

 

This is possible to have 2 arguments in a conditional statement.

 

For an Example,

 

Column = IF(AND(PBI_Data_2[Region1]= "East", PBI_Data_2[Representative1] = "Parent"),"Fully Depriciated",

                         IF(PBI_Data_2[Region1] = "East" && PBI_Data_2[Item1] = "Pen","Fully Depriciated","Not Depriciated"))

 

You can && operator for both the conditions or use AND before and delimited by , in between both the conditions.

 

I think, this would be helpful for you.

 

Regards,

Pradeep

Thank you so much Capture.PNG

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors