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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Compare 2 columns and return value to one column

Hello community

I have the following query, what logic would apply if the values in column 1 are less than column 2, then the value in column 1 would move to column 2

Column 1Column 2
3850
15
23
1250
11

This should be the result.

Column 1Column 2
3850
1515
2323
1250
1111

Thank you

7 REPLIES 7
Anonymous
Not applicable

Hi @Syndicate_Admin,

I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.

Please continue using Microsoft community forum.

Thank you,
Pavan.

Anonymous
Not applicable

Hi @Syndicate_Admin,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept  as  Solution" and give a 'Kudos' so other members can easily find it.

Thank you,
Pavan.

Anonymous
Not applicable

Hi @Syndicate_Admin,

Thank you for reaching out in Microsoft Community Forum.

Thank you @rajendraongole1   for the helpful response.

As suggested by rajendraongole1,  I hope this information was helpful. Please let me know if you have any further questions or you'd like to discuss this further. If this answers your question, please "Accept as Solution" and give it a 'Kudos' so others can find it easily.

Please continue using Microsoft community forum.

Regards,
Pavan.

rajendraongole1
Super User
Super User

Did I answer your question? we can achieve the same in Power query editor. please check and mark my post as a solution if it meets.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





rajendraongole1
Super User
Super User

Hi @Syndicate_Admin  - You can create a new column in Power BI and use the below logic

New_Column2 =
IF('Table1'[Column 1] < 'Table1'[Column 2] || ISBLANK('Table1'[Column 2]), 'Table1'[Column 1], 'Table1'[Column 2])

 

rajendraongole1_1-1743241360502.png

 

Hope this helps.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks for the help, however I wouldn't want to create a new column because I have 50 columns to compare, and it would be cumbersome for me to create 50 more columns, so I needed to replace it in the same column.

 

HI @Syndicate_Admin - Open Power Query Editor (Transform Data).
Select Column 2 (the one you want to modify).
Click on "Add Column" → "Custom Column" and enter this formula:

 

rajendraongole1_0-1743338971216.png

 

 

output using custom column:

 

rajendraongole1_1-1743339003556.png

 

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Top Kudoed Authors