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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
chrismoncrief
Frequent Visitor

IF-Then using columns

I am trying to create a query that would return values from a column based upon the label from another column.

 

chrismoncrief_0-1736972268590.png

In the column for Allocation Pallets I am looking that any line that shows allocation then place the qty from Pallets` into the allocation pallets column.

2 ACCEPTED SOLUTIONS
PwerQueryKees
Super User
Super User

Try this in the formula bar and replace #"Changed Type" with the name of the previous step.

= Table.ReplaceValue(#"Changed Type", each if [Inventory Status] = "Allocation" then [Allocation Pallets] else false, each [Pallets],Replacer.ReplaceValue,{"Allocation Pallets"})

 

View solution in original post

rohit1991
Super User
Super User

To create the Allocation Pallets column in Power Query:

  1. Add Conditional Column: Go to Add Column > Conditional Column.

    • Set:
      • Column Name: Allocation Pallets.
      • Condition: Inventory Status = "Allocation".
      • Output: Pallets.
      • Else: 0.
  2. Formula Alternative: Use this formula if editing directly: = Table.AddColumn(Source, "Allocation Pallets", each if [Inventory Status] = "Allocation" then [Pallets] else 0)


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @chrismoncrief ,
We haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.If community member response addressed your query, please mark it as Accept as Solution and click Yes if you found it helpful.If you have any further questions, feel free to reach out.

Thank you for being a part of the Microsoft Fabric Community Forum!


Anonymous
Not applicable

Hi @chrismoncrief ,
Thank you for the helpful answer @rohit1991  and @PwerQueryKees .
I just wanted to kindly follow up to see if you had a chance to review the previous response provided by community members. Please let us know if it was helpful. If yes, please Accept the answer so that it will be helpful to others to find it quickly.

rohit1991
Super User
Super User

To create the Allocation Pallets column in Power Query:

  1. Add Conditional Column: Go to Add Column > Conditional Column.

    • Set:
      • Column Name: Allocation Pallets.
      • Condition: Inventory Status = "Allocation".
      • Output: Pallets.
      • Else: 0.
  2. Formula Alternative: Use this formula if editing directly: = Table.AddColumn(Source, "Allocation Pallets", each if [Inventory Status] = "Allocation" then [Pallets] else 0)


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
PwerQueryKees
Super User
Super User

Try this in the formula bar and replace #"Changed Type" with the name of the previous step.

= Table.ReplaceValue(#"Changed Type", each if [Inventory Status] = "Allocation" then [Allocation Pallets] else false, each [Pallets],Replacer.ReplaceValue,{"Allocation Pallets"})

 

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.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

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.