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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Luca2020
Helper I
Helper I

Sum rows with same id and then divide each row for that sum

Hi, 

I've a table with ID, Hours of Working  and Date of Working. 

I'd like to calculate the completion rate for each ID for each month, like: 

 

ID          H                   DATE

1            2           30 JANUARY 2021

1            3           31 JANUARY 2021

1            2           01 FEBRUARY 2021

 

ID 1 took 7 hours of work, 5 h in january and 2 h in february. Completion Rate in January 5/7 = 71%

 

I need this % to divide costs and revenues according to this % (true revenue in january 100.000 € * 71%)

 

I'd prefer solving this with a measure but a calculated column is also fine. 

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Luca2020 , You can measure like

divide(Sum(Table[H]), calculate(Sum(Table[H]), filter(allselected(Table), Table[ID] = max(Table[ID]))))

 

Then multiply that with revenue

 

divide(Sum(Table[H]), calculate(Sum(Table[H]), filter(allselected(Table), Table[ID] = max(Table[ID])))) * sum(Table[Revenue])

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Luca2020 , You can measure like

divide(Sum(Table[H]), calculate(Sum(Table[H]), filter(allselected(Table), Table[ID] = max(Table[ID]))))

 

Then multiply that with revenue

 

divide(Sum(Table[H]), calculate(Sum(Table[H]), filter(allselected(Table), Table[ID] = max(Table[ID])))) * sum(Table[Revenue])

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.