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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
v-pagayam-msft
Community Support
Community Support

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!


v-pagayam-msft
Community Support
Community Support

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors