cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JShafer26554
Frequent Visitor

Creating Logic within Power Query Editor?

Hi all,

 

Novice PowerBI user here. I have a few queries that I have loaded within a workbook, and I'm attempting to create a column within that table that looks at ANOTHER table, takes the latest date we have (in this case, would be 6/14/2021), and populates the column with it.

 

Is there some easy way to figure this out, or am I grasping at straws?

1 ACCEPTED SOLUTION
TomMartens
Super User II
Super User II

Hey @JShafer26554 ,

 

this is not easy as one would hope, this is because referencing other tables (other queries) from within a query requires some M code.

 

Then you can consider using List.Max (<List.Max - PowerQuery M | Microsoft Docs) in combination with Table.SelectColumns (Table.SelectColumns - PowerQuery M | Microsoft Docs) to store the MAX date.

 

If you need more guidance, create a pbix that contains sample data, but still reflects your data model. Upload the pbix to onedrive or dropbox and share the link. If you are using Excel to create the sample data, share the xlsx as well.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User II
Super User II

Hey @JShafer26554 ,

this is great!

Maybe you will find some time to provide a short outline of your solution and mark your post as an answer, as this will help others who have similar questions.

Thanks,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
HashamNiaz
Solution Sage
Solution Sage

Hi @JShafer26554 !

 

You can first create a relationship between these table, like any joining key which is common in 2 tables, then use RELATEDTABLE() DAX function to achive the results;

 

RELATEDTABLE() 

 

Regards,

Hasham

TomMartens
Super User II
Super User II

Hey @JShafer26554 ,

 

this is not easy as one would hope, this is because referencing other tables (other queries) from within a query requires some M code.

 

Then you can consider using List.Max (<List.Max - PowerQuery M | Microsoft Docs) in combination with Table.SelectColumns (Table.SelectColumns - PowerQuery M | Microsoft Docs) to store the MAX date.

 

If you need more guidance, create a pbix that contains sample data, but still reflects your data model. Upload the pbix to onedrive or dropbox and share the link. If you are using Excel to create the sample data, share the xlsx as well.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

Thanks Tom! I actually sat down with a coworker who has a little more PowerBI experience than I do and we were able to use your suggestion to find an effective solution!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - July 22, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Top Solution Authors
Top Kudoed Authors