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
Anonymous
Not applicable

PowerQuery - Custom Conditional Column with Multiple Conditions

I am attempting to create a custom conditional column in PowerQuery. The goal is to create a column in my data set named "Picklist Update Needed" which will display a simple 'Yes' or 'No' for each row.

 

There are four columns in my data set ('On POS', 'Add-Short', 'Picklist Updated', 'Cancellation') that are involved in the logic for this column, below is chart showing the conditions that would result in a 'Yes' to populate in the custom conditional column.

 

On POS     Add - ShortPicklist UpdatedCancellation
NoAddNoBLANK
NoShortNoBLANK
YesShortNoBLANK

 

If the combinations are anything other than these three above, the result would be 'No'.

 

What would the DAX code look like to create this?

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Here is a column expression that shows one way to do it. Replace MultiColumn with your actual table name.

 

NewColumn =
VAR picklistcancellation =
    AND (
        MultiColumn[Picklist Updated] = "No",
        MultiColumn[Cancellation] = "BLANK"
    )
VAR otherconditions =
    OR (
        OR (
            AND ( MultiColumn[On POS     ] = "No", MultiColumn[Add - Short] = "Add" ),
            AND ( MultiColumn[On POS     ] = "No", MultiColumn[Add - Short] = "Short" )
        ),
        AND ( MultiColumn[On POS     ] = "Yes", MultiColumn[Add - Short] = "Short" )
    )
RETURN
    IF ( AND ( picklistcancellationotherconditions )"Yes""No" )

 

mahoneypat_0-1642026271052.png

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

Here is a column expression that shows one way to do it. Replace MultiColumn with your actual table name.

 

NewColumn =
VAR picklistcancellation =
    AND (
        MultiColumn[Picklist Updated] = "No",
        MultiColumn[Cancellation] = "BLANK"
    )
VAR otherconditions =
    OR (
        OR (
            AND ( MultiColumn[On POS     ] = "No", MultiColumn[Add - Short] = "Add" ),
            AND ( MultiColumn[On POS     ] = "No", MultiColumn[Add - Short] = "Short" )
        ),
        AND ( MultiColumn[On POS     ] = "Yes", MultiColumn[Add - Short] = "Short" )
    )
RETURN
    IF ( AND ( picklistcancellationotherconditions )"Yes""No" )

 

mahoneypat_0-1642026271052.png

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Wow! Thank you! That worked perfectly. I will have to study exactly what you did there because it certainly isn't what I was thinking, which I couldn't get to work.

 

Thanks again!

VahidDM
Super User
Super User

Hi @Anonymous 

 

I think you missed to add the condition chart?

 


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Anonymous
Not applicable

Looks like I got a solution already. Thanks for helping out.

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.