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
DianneB
Frequent Visitor

How do I get a single value based on three queries that need to match

Hi,

I have two tables (1 and 2) - I want to match details in Table 1 with Table 2 to get unique value (result)?

There will be many combinations - each with a unique result.

 

DianneB_0-1641268790679.png

 

Thanks

Di

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @DianneB ,
yes that makes sense.
Looks like an (Excel) Lookup. In Power Query you do this with a Merge of the 2 tables:
Go to table 1 and merge table 2 to it on the 3 key-columns  like described here: Merge queries (Power Query) (microsoft.com)
or here: Advanced Excel Power Query - Merge Queries with 3 Lookup Columns - YouTube
Then expand the Emission Factor column.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

3 REPLIES 3
ImkeF
Community Champion
Community Champion

I don't understand your request. Specifically: What is the logic behind the desired result/unique values

Please read the guidelines on how to get your questions answerd quickly: help how to get your questions answered quickly - Microsoft Power BI Community 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

DianneB
Frequent Visitor

Hi and thanks for your comment - let me try and explain a bit further and this time I will use the actual data query.

 

What my ultimate aim is to find the applicable emission factor based on three parameters - tank type, fuel type and weather zone.  The emission factor will vary depending on these three parameters.

 

On one table, I have site details which will list the three parameters and on another table I have the emission factors listed for each combination possible for these three parameters.  A site can have only one weather zone but can have multiple tank types and fuel types.

 

I have highlighted below what the result should be for a few examples.  Does this make more sense?  There are many more tank types and fuel types that I have not listed, but once I get the logic and formula correct (with your help if possible), I can accordingly adjust.

 

DianneB_0-1641327499514.png

 

 

 

ImkeF
Community Champion
Community Champion

Hi @DianneB ,
yes that makes sense.
Looks like an (Excel) Lookup. In Power Query you do this with a Merge of the 2 tables:
Go to table 1 and merge table 2 to it on the 3 key-columns  like described here: Merge queries (Power Query) (microsoft.com)
or here: Advanced Excel Power Query - Merge Queries with 3 Lookup Columns - YouTube
Then expand the Emission Factor column.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

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 Kudoed Authors