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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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