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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Nested If Statements in Power Query referring to fields from different tables

I am using power query to automate a certain process and now I am at the stage where I have to build a table where each column will be based on calculations using inputs from columns from different tables. 

 

The query written in simple language would be something like this:

 

If total earnings >0 AND employeestaging.uniondescription != "A" AND employeestaging.uniondescription !="B" AND deductionsummary.union = 0, then "Check" else "Ok")

 

Any idea how  can do this in Power Query?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can refer the following links to get it:

Power Query method:

Filter Data with Multiple Criteria using Power Query

yingyinr_0-1654672752306.png

DAX method:

Combined IF-statements from two different tables

Conditional column based on value from another table with matching values

yingyinr_1-1654672903514.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can refer the following links to get it:

Power Query method:

Filter Data with Multiple Criteria using Power Query

yingyinr_0-1654672752306.png

DAX method:

Combined IF-statements from two different tables

Conditional column based on value from another table with matching values

yingyinr_1-1654672903514.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , if you want to use a column across the table in a power query you need to merge tables

 

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.