web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power BI query NATURAL...
Power Automate
Unanswered

Power BI query NATURALLEFTOUTERJOIN with a GROUPBY

(0) ShareShare
ReportReport
Posted on by

Hi friends!

I am a newbie at Power Automate, and I am working to automate a long work process, taking data from Power BI and then inserting it into another data management system. There is a many to one relationship between the two tables, leading to many rows with the same identifier. 

 

The goal of this DAX query is to:

- Join the two tables in a left join

- Get all the columns needed from both tables

- Aggregate the measure fields, grouped by the identifier field

- Return the new table with one row per identifier field

 

I have tried all sorts of combinations of SUMMARIZE, SUMMARIZECOLUMNS, GROUPBY, etc. The issue I am finding is that if I gather all the data BEFORE doing the join,  I can either do the left join, OR get the aggregation, but because the relationship between the two tables isn't naturally recognized, I have to do Table[identifier]&"" when selecting the identifier row in both tables, invalidating it in the GROUPBY and throwing the error that there are too many unique identifiers per row.

 

Now, I have been trying to do the join FIRST, and then get all the data with a GROUPBY. The issue I am running into is that the NATURALLEFTOUTERJOIN table is resulting in headers like this: Table[field]. Then if I try to reference that header, I have to do it like this NewTable[Table[field]] which throws an error because brackets aren't allowed in the field names.

 

EVALUATE

VAR JoinedTable = NATURALLEFTOUTERJOIN('Table1', 'Table2')

VAR GroupedTable =

GROUPBY(JoinedTable,

JoinedTable[Table1[item1]],

JoinedTable[Table1[item2]],

Etc.

"itemx", SUMX(CURRENTGROUP(), JoinedTable[Table2[itemx]]))

RETURN GroupedTable

 

Does anyone know of any way to go around this? I am super familiar with SQL, but it is messing up the way I think about table queries. Any help is super appreciated!

 

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,551 Super User 2025 Season 2 on at

    how are these tables joined in the data model of the Power BI dataset?  Can you maybe provide sample data for each table and indicate the expected outcome?  Then we could propose a suitable DAX query.

     

    If you prefer to troubleshoot it yourself you will want to use DAX Studio for the modeling/refactoring.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#3
David_MA Profile Picture

David_MA 270 Super User 2025 Season 2

Last 30 days Overall leaderboard