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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Loosing key (link) after groupby

Hi, I have a table that is linked to another table through a key, and now I need to do some grouping in the first table to do some later visualization. However, after I do the groupby, the key is no longer included in the table and it became disconnected from the rest of tables. What should I do to keep the key (link) while grouping without the key...? 

4 REPLIES 4
Greg_Deckler
Super User
Super User

You either need to include the Key column in the GROUPBY group area or include it in the columns area like:

 

GROUPBY(

  'Table',

  [Some column],

  [Key],

  "Some aggregation",SUMX(CURRENTGROUP(),[Column])

)

 

or

 

GROUPBY(

  'Table',

  [Some column],

  "Key",MAXX(CURRENTGROUP(),[Key])

)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you. ... However, where is EARLIER in the codes? And what do you mean by som column and some aggregation?

Oh, never mind about the EARLIER, that's just a joke, it is in my signature.

 

You didn't provide sample data so I wasn't sure what kinds of columns and such I was dealing with so I just used place holders.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks. I found a way to circumvent the problem... but I dont have a solution to the problem yet. Let me prepare the dataset and edit the question later...

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.