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
Syl4
New Member

Sum of values with condition in another column

Hello team, 

 

I'd like to calculate the sum of the task duration for each project mentioned in the PROJECT NAME column. 

Is it something possible in PowerBI please ? 

 

Here is my table to ease understanding. 

I'd like to create the column named "Sum of durations for each project" without adding a condition on the project name because there are tens of projects.

PROJECT NAMEPhasetaskDurationSum of durations for each project
Project1Phase1   357
Project1Phase14957
Project1Phase1557
Project1Phase22587
Project1Phase26287
Project1Phase322
Project1Phase302
Project1Phase42943
Project1Phase4743
Project1Phase4743
Project1Phase54242
Project22Phase16080
Project22Phase12080
Project22Phase23067
Project22Phase2267
Project22Phase22567
Project22Phase21067
Project22Phase3515
Project22Phase31015
Project22Phase42026
Project22Phase4326
Project22Phase4326
Project22Phase55050


For now, I didn't succeed 😐.

 

 

Thanks for your advices 🙂

1 ACCEPTED SOLUTION
Rupak_bi
Solution Sage
Solution Sage

here is your solution:

Rupak_bi_0-1724668134985.png

Calculated duration = calculate(sum('Table (3)'[taskDuration]),ALLEXCEPT('Table (3)','Table (3)'[PROJECT NAME],'Table (3)'[Phase]))
 
if this is what you want, plz accept as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

View solution in original post

3 REPLIES 3
Syl4
New Member

Perfect, thank you !

I'm too new in PowerBI, not clear to me how it works for now, but I'm going to check that deeper. 

dharmendars007
Super User
Super User

Hello @Syl4 , 

 

Please try this measure , this should work...


Project_Group =
                CALCULATE(SUM('Table'[taskDuration]),
                            ALLEXCEPT('Table',
                            'Table'[PROJECT NAME], 'Table'[Phase]))

dharmendars007_0-1724668811463.png

 

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 


Rupak_bi
Solution Sage
Solution Sage

here is your solution:

Rupak_bi_0-1724668134985.png

Calculated duration = calculate(sum('Table (3)'[taskDuration]),ALLEXCEPT('Table (3)','Table (3)'[PROJECT NAME],'Table (3)'[Phase]))
 
if this is what you want, plz accept as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

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.