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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mmoizk
Helper III
Helper III

Reporting on Many to many

I have 3 datasets DS1, DS2 & DS3. 

 

Example 

DS1

DS1ID          Name                 DS2ID

1                   T1                         1

1                   T1                         2

1                   T1                         3

2                   T2                         4

2                   T2                         3

2                   T2                         5

3                   T3                         1

3                   T3                         6

 

DS2

DS2ID          DS2Name             

1                   S1

2                   S2

3                   S3

4                   S4

5                   S5

6                   S6

 

 

DS3

DS2ID          PName

1                   p1

1                   p2

2                   p3

2                   p4

3                   p1

3                   p3

4                   p5

4                   p6

5                   p2

5                   p3

 

Now the report need to count all Trans in DS1 for a Giver PName

 

PName           Count of DS1.Name

p1                         3

p2                         1

..                          ...

1 ACCEPTED SOLUTION

@mmoizk Which visual are you using ? When you pick a field from third table have you specified you want the count instead of Don't summarize (if you're using table).

 

Capture.PNG

View solution in original post

7 REPLIES 7
ankitpatira
Community Champion
Community Champion

@mmoizk It is simple. You should have your relationships that looks like below. In any visual select name from TAB1 and Count of PName from TAB3.

 

 

Capture.PNG

Thanks Ankit Patira, I wish it was that easy . I did extactly that but when i pic something from the 3rd table i get an error. 

Many2Many.JPGMany2ManyError.JPGMany2ManyErrorDetails.JPG

@mmoizk Which visual are you using ? When you pick a field from third table have you specified you want the count instead of Don't summarize (if you're using table).

 

Capture.PNG

i was using a table visual which was erroring. If i use any other chart with a measure of sum or count i am able to report on the 3rd table. Thanks

Sean
Community Champion
Community Champion

@mmoizk can you explain how you get your totals? I get other totals with your setup???Report - M2M.png

 

Hi Sean, Sorry i didn't mention this earlier but count are actually Distict count of DS1ID .

Sean
Community Champion
Community Champion

@mmoizk I still get different results - but all you need is a simple distinct count measure.

 

Distinct Names = DISTINCTCOUNT(DS1[Name])

Report - M2M2.png

EDIT: If your setup is the same it should work.

Report - M2M3.png

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.