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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
HassanAshas
Helper V
Helper V

How to find the total contribution % of each Department towards Total Number?

Hi, I have records of Employees working in different Competencies and Practices. For each employee, I have Billed and Unbilled Hours.

 

The data looks something like this, 

 

Emp_IDEmp_NameCompetencyPracticeBilled HoursUnbilled Hours
25SamData & IntegrationML1105
26EmmaDevelopmentPython7525
27OwenData & IntegrationData Engineering9530
28IsabellaDesignUI/UX2570
29LiamData & IntegrationETL8540
30NoraDevelopmentJava0125
31WilliamData & IntegrationBI4560
32AvaDevelopment.NET0100
33ElijahDesignInteraction Design3550
34SophiaData & IntegrationCloud5535
35LucasDevelopmentJavaScript0120
36OliviaDesignVisual Design1585
37NoahData & IntegrationML12515
38GraceDevelopmentRuby0110
39HenryDesignUsability Testing595
40MiaData & IntegrationETL6545
41AidenDevelopmentC++0130
42EllaDesignUI/UX3060
43JacobData & IntegrationBI8020
44ChloeDevelopmentPython0

130

 

My aim is to find Unbilled Hours Ratio. Formula of Unbilled Hours Ratio is, 

 

 

 

 

Unbilled Hours Ratio = Unbilled Hours / (Billed Hours + Unbilled Hours)

 

 

This, I have already implemented using following DAX, 

 

Unbilled Hours Ratio = 

var _UnbilledHours = SUM(Employees[Unbilled Hours])
var _BilledHours = SUM(Employees[Billed Hours])
var _TotalHours = _UnbilledHours + _BilledHours

var _Result = 
    DIVIDE(
        _UnbilledHours, 
        _TotalHours
    )
return _Result

 

 

This is giving me the value of 61.5%. 

Now, I want a Bar Chart that shows % values each "Competency" and each "Practice" is contributing towards this 61.5%. 

For now, I have the following visual, 

 

HassanAshas_0-1692363925017.png

 

This basically shows me the Unbilled Hours Ratio for each Competency. I don't want that, I want to find the percentage value each Competency contributed towards the 61.5%. 

The similar will be done for Practices as well (so if I drill down to all the Practices for one Competency, it will show me the % values each Practice contributed towards the total % percentage value of the Competency Unbilled Hours Ratio) 

 

Can anyone help in creating a DAX for this scenario? 

 

If you would like to download the Sample Power BI File, you may do so from here: https://drive.google.com/file/d/1CM918As9DGGt3daOtHaGpYYVkc8IjmZi/view?usp=sharing

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@HassanAshas 

Are these the % you are looking for?

jdbuchanan71_0-1692423927426.png

Unbilled Hours Ratio = 

var _UnbilledHours = SUM(Employees[Unbilled Hours])
var _BilledHours = SUM(Employees[Billed Hours])
var _TotalHours = _UnbilledHours + _BilledHours
VAR _FullTotal = CALCULATE ( SUM ( Employees[Unbilled Hours] ), ALL(Employees) ) + CALCULATE ( SUM ( Employees[Billed Hours] ), ALL(Employees) ) 

var _Result = 
    DIVIDE(
        _UnbilledHours, 
        _FullTotal
    )
return _Result

 

View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Proportion chart.pbix

 

Why not use pie chart to intuitively reveal relative proportion?

ThxAlot_0-1692425473834.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



jdbuchanan71
Super User
Super User

@HassanAshas 

Are these the % you are looking for?

jdbuchanan71_0-1692423927426.png

Unbilled Hours Ratio = 

var _UnbilledHours = SUM(Employees[Unbilled Hours])
var _BilledHours = SUM(Employees[Billed Hours])
var _TotalHours = _UnbilledHours + _BilledHours
VAR _FullTotal = CALCULATE ( SUM ( Employees[Unbilled Hours] ), ALL(Employees) ) + CALCULATE ( SUM ( Employees[Billed Hours] ), ALL(Employees) ) 

var _Result = 
    DIVIDE(
        _UnbilledHours, 
        _FullTotal
    )
return _Result

 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.