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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eddieatchisonam
Regular Visitor

Unique many to many relationship

Greetings! 

 

I have 2 data sources. 

 

1 table has a unique account number, but non unique name, and some additional dollar amounts, etc. 
2 table has many non unique account numbers, and non unique names, additional dollars, etc. 

Table 1 is the accounts list. So for example: 

 Client NameAccount Number Client Reference NumberAssign Date Assigned Amount Principal Due Sts Name1 ClientJudgment DateTie Series Total Due
APC3750X28614661/7/201617.530PIFJONES,MIKEAPCCOM 38620
APC3751X30945131/7/2020582.410PIFJONES,MIKEAPCCOM 0123.58
APC3752X31794471/7/20169375.59375.5XSTSMITH,SUSIEAPC-SP 386315867.72
APC3753     FREDERICK,ALLISON    
APC3754X28713171/7/20162818.370PIFSCOTT,FREDERICK APCCOM 3865313.3
APC3755X26286751/7/2016277.690.2PIFSCOTT,FREDERICK APCCOM 388843.06
APC3756X28862081/8/2020586.640PIFSCOTT,FREDERICK APCCOM 0143.61
AAPC3757X30435851/7/2016250.910PIFBART,RICHARD APCCOM 055.65
APC3758X30617511/7/2016562.360PIFBART,RICHARDAPCCOM 0121.64

Table is the transaction list. 

Account NumberTransaction CodeAmountTransaction Date
37502533.14/30/2020
375041596.191/2/2020
375441596.191/8/2020
375641591.991/21/2020
375741596.191/23/2020


I'm having trouble I guess getting the two to link. What I really need to find right now is: 

The sum of transaction_Amount - IF payments were made to accounts that were assigned in a previous year, but the same individual was assigned in 2020. 

So Mike Jones was assigned in 2016 and 2020. His transactions were only applied to the 2016 accounts, but since he was assigned other account in 2020, i should get a total of 129.29 for him. 
Whereas:  frederick scott was assigned in 2016 , twice, and 2020. his transactions were applied to a 2016 and the 2020. so i should only get 96.19 for the transaction amount made in 2020 that was applied to the account assigned in 2016.


And no others should show in the total, as they didn't have assigned in 2020 and payments applied to previous assigned dates. 

I've tried explaining this before, and no luck. I hope for help as I've spent at least 30-40 hours trying to figure this out. 


I believe it has something to do with the linking of the many to many as even the simple visualtizations i try to do don't work out correctly. 

Any help would be appreciated. Thank you. 

2 REPLIES 2
eddieatchisonam
Regular Visitor

i'll break this down to smaller projects and see what i can do. thanks! 

amitchandak
Super User
Super User

@eddieatchisonam , While I am not able to get the complete problem. It needs to be broken into smaller problems.

 

One thing is that you need a common account table. And a date table joined with both of these table

https://www.youtube.com/watch?v=Bkf35Roman8

https://www.seerinteractive.com/blog/join-many-many-power-bi/

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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