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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AlejandroPCar
Helper IV
Helper IV

Summarize with M2M relationships

Hi,

 

How can I create a SUMMARIZE between two tables whose have a Many to Many relationship? Right-hand activities table vs left-hand people table. The idea is to know how many activities can a person achieve. The common column is the groupID, so a person can be in only 1 group, but a group is composed of many activities. 

 

Thanks for your help.

1 ACCEPTED SOLUTION

Hello @AlejandroPCar 

 

You need to create a Group table with this DAX query:

 

Groups = 
DISTINCT( UNION( ALLNOBLANKROW( Activities[groupID] ), ALLNOBLANKROW( People[groupID] ) ) )

then create these relationships:

 

Capture.PNG

 

then drop the person ID on the matrix rows and add this measure:

 

Measure = 
CALCULATE(
    COUNTROWS( Activities ),
    CROSSFILTER( People[groupID], Groups[groupID], Both )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

4 REPLIES 4
LivioLanzo
Solution Sage
Solution Sage

Hello @AlejandroPCar,

 

could you post a sample of your data?

 

thanks

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hello @AlejandroPCar 

 

You need to create a Group table with this DAX query:

 

Groups = 
DISTINCT( UNION( ALLNOBLANKROW( Activities[groupID] ), ALLNOBLANKROW( People[groupID] ) ) )

then create these relationships:

 

Capture.PNG

 

then drop the person ID on the matrix rows and add this measure:

 

Measure = 
CALCULATE(
    COUNTROWS( Activities ),
    CROSSFILTER( People[groupID], Groups[groupID], Both )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Hello @LivioLanzo

 

It works enough well. Thanks a lot. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors