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

Join 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.

Reply
Anonymous
Not applicable

Need to sum Amount for the minimun values only in a field

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

AccountLocRiskVeh Nr
A150376999999951
A150376999999911
A150376999999981
A150376999999971
A150376999999921
A150376999999941
A150376999999931
A150376999999991
A150376999999961

Table 2

 

AccountLocRiskENDRAmount
A1503769999999906443
A15037699999998060
A150376999999970167
A150376999999960344
A1503769999999501034
A15037699999994020
A15037699999993033
A1503769999999200
A1503769999999100
A150376999999991-6443
A150376999999981-60
A150376999999971-167
A150376999999961-344
A150376999999951-1034
A150376999999941-20
A150376999999931-33
A1503769999999926443
A15037699999998260
A150376999999972167
A150376999999962344
A1503769999999521034
A15037699999994220
A15037699999993233
A1503769999999220
A1503769999999120
A150376999999996-5489
A150376999999986-51
A150376999999976-142
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

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.

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@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 ])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ashish_Mathur
Super User
Super User

Hi,

Please show the exact result that you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jdbuchanan71
Super User
Super User

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 applicable

I did get it to work.  I appreciate your help and Thank you.

Anonymous
Not applicable

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors