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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
skors
Regular Visitor

Percentage of row total - Milestones

Dear Power BI people,

 

I have a delicate issue that I don’t manage to solve by myself, so I wanted to reach out to you. I have seen that the same problem has been posted a lot of times, but the proposed solutions does not work out for me.

 

Here it is:

 

In the table beneath, you can see a lot of milestones in a specific project. What I want to do is to calculate the weight of each milestone based on their workload (duration) in percent

 

I know I can do this easily by applying the function” show value as percent of grand total”, but I really need this as a measure (or column?) because I want to use it further on in other calculations. I know the calculation is really simple (workload in days per milestone / total duration), but I am not able to do this in Power BI.

 

I have tried this with no luck:

Duration total for Action Title = DIVIDE(SUM(Actions[Duration];CALCULATE(SUM(Actions[Duration];ALLSELECTED(Actions[Duration])))))

 

By the way: the duration (execution days per milestone) field is calculated as follows:

Duration = DATEDIFF(Actions[StartDate];Actions[Deadline];DAY).

 

Milestone Table.jpg

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @skors,

 

IF [Duration] means calculate column, you can try to use below measure:

 

 

Duration total for Action Title =
DIVIDE (
    CALCULATE ( SUM ( Actions[Duration] ); VALUES ( Actions[Actions Title] ) );
    CALCULATE ( SUM ( Actions[Duration] ); ALLSELECTED ( Actions ) );
    -1
)

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @skors,

 

IF [Duration] means calculate column, you can try to use below measure:

 

 

Duration total for Action Title =
DIVIDE (
    CALCULATE ( SUM ( Actions[Duration] ); VALUES ( Actions[Actions Title] ) );
    CALCULATE ( SUM ( Actions[Duration] ); ALLSELECTED ( Actions ) );
    -1
)

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Wonderful, thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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