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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Alice2222
New Member

Power Query - Getting value from matrix in another table

I'm looking for some help please with this scenario which is too complex for me to resolve with my power query knowledge (in excel I would use Index/Match formula to achive it).

 

Here's what I have:

 

Table1 I have 2 columns:

  • Date of which record was created
  • Country 

Alice2222_0-1690036584105.png

 

In Table2 I have the below matrix:

  • First Column -> Date of which record was created
  • Column Header -> all the possible countries

Alice2222_2-1690036843383.png

 

is there a function that will allow me to get into Table1 a new column containing the value corrisponding to the Date/Country match?

Example:

if Date of which record was created = 24/07/2023 & Country = Lu - Luxemburg -> FW23 soft launch
if Date of which record was created = 24/07/2023 & Country = Be - Belgium-> SS23 W3


Thanks

 

 

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

Hi @Alice2222 ,

According to your description, here's my solution.

Table:

vyanjiangmsft_1-1690269815250.png

Table(2):

vyanjiangmsft_0-1690269791394.png

1.Add a custom column in Table:

let a=[Country Key] in
Table.SelectColumns(Table.SelectRows(#"Table (2)",(x)=>x[Date of Which Record Was Created]=[Date of Which Record Was Created]),{a})

2.Expand the new added column.

3.Add another custom column:

List.Max({[#"Custom.FR-France"],[#"Custom.DE-Germany"],[#"Custom.BE-Belglum"]})

4.Remove other unneeded columns, get the correct result:

vyanjiangmsft_2-1690270088575.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

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-yanjiang-msft
Community Support
Community Support

Hi @Alice2222 ,

According to your description, here's my solution.

Table:

vyanjiangmsft_1-1690269815250.png

Table(2):

vyanjiangmsft_0-1690269791394.png

1.Add a custom column in Table:

let a=[Country Key] in
Table.SelectColumns(Table.SelectRows(#"Table (2)",(x)=>x[Date of Which Record Was Created]=[Date of Which Record Was Created]),{a})

2.Expand the new added column.

3.Add another custom column:

List.Max({[#"Custom.FR-France"],[#"Custom.DE-Germany"],[#"Custom.BE-Belglum"]})

4.Remove other unneeded columns, get the correct result:

vyanjiangmsft_2-1690270088575.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

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

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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