Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have 2 unrelated tables with many to many records for Key, Loc, Risk are the fields in both tables. From Table 2, I need to Sum the Amount for only the mimimun ENDR value for each Key. Can someone suggest the best way to accomplish this? Below is an example of the 2 Power BI table.
Table 1
Account | Loc | Risk | Veh Nr |
A150376 | 9999 | 9995 | 1 |
A150376 | 9999 | 9991 | 1 |
A150376 | 9999 | 9998 | 1 |
A150376 | 9999 | 9997 | 1 |
A150376 | 9999 | 9992 | 1 |
A150376 | 9999 | 9994 | 1 |
A150376 | 9999 | 9993 | 1 |
A150376 | 9999 | 9999 | 1 |
A150376 | 9999 | 9996 | 1 |
Table 2
Account | Loc | Risk | ENDR | Amount |
A150376 | 9999 | 9999 | 0 | 6443 |
A150376 | 9999 | 9998 | 0 | 60 |
A150376 | 9999 | 9997 | 0 | 167 |
A150376 | 9999 | 9996 | 0 | 344 |
A150376 | 9999 | 9995 | 0 | 1034 |
A150376 | 9999 | 9994 | 0 | 20 |
A150376 | 9999 | 9993 | 0 | 33 |
A150376 | 9999 | 9992 | 0 | 0 |
A150376 | 9999 | 9991 | 0 | 0 |
A150376 | 9999 | 9999 | 1 | -6443 |
A150376 | 9999 | 9998 | 1 | -60 |
A150376 | 9999 | 9997 | 1 | -167 |
A150376 | 9999 | 9996 | 1 | -344 |
A150376 | 9999 | 9995 | 1 | -1034 |
A150376 | 9999 | 9994 | 1 | -20 |
A150376 | 9999 | 9993 | 1 | -33 |
A150376 | 9999 | 9999 | 2 | 6443 |
A150376 | 9999 | 9998 | 2 | 60 |
A150376 | 9999 | 9997 | 2 | 167 |
A150376 | 9999 | 9996 | 2 | 344 |
A150376 | 9999 | 9995 | 2 | 1034 |
A150376 | 9999 | 9994 | 2 | 20 |
A150376 | 9999 | 9993 | 2 | 33 |
A150376 | 9999 | 9992 | 2 | 0 |
A150376 | 9999 | 9991 | 2 | 0 |
A150376 | 9999 | 9999 | 6 | -5489 |
A150376 | 9999 | 9998 | 6 | -51 |
A150376 | 9999 | 9997 | 6 | -142 |
Solved! Go to Solution.
Hi @mmsalisbury
I was able to get there with a calculated column to add the MIN ENDR to table 1 and then a measure to calculate the sum. Take a look at the attachment. In my example I changed one of the ENDR to have a minimum of 1 instead of 0 for testing.
@Anonymous , Not Clear Try Like
New column in Table 1
Amount =min(Table2,table2[Account]=table1[Account] && table2[Loc]=table1[Loc] && table2[Risk]=table1[Risk]),table2[Amount ])
or
first New column in Table 1
ENDR =min(Table2,table2[Account]=table1[Account] && table2[Loc]=table1[Loc] && table2[Risk]=table1[Risk]),table2[ENDR ])
second New column in Table 1
Amount =min(Table2,table2[Account]=table1[Account] && table2[Loc]=table1[Loc] && table2[Risk]=table1[Risk] && table2[ENDR]=table1[ENDR]) ),table2[ENDR ])
Hi,
Please show the exact result that you are expecting.
Hi @mmsalisbury
I was able to get there with a calculated column to add the MIN ENDR to table 1 and then a measure to calculate the sum. Take a look at the attachment. In my example I changed one of the ENDR to have a minimum of 1 instead of 0 for testing.
I did get it to work. I appreciate your help and Thank you.
I understand your result and you related the tables. Can this be accomplished without relating tables due to many to many?
I didn't relate the tables. If you look at my sample they are not joined.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
42 | |
31 | |
27 | |
27 |