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
mork
Helper V
Helper V

Help with DAX formula

Hello all,

I have two tables. One with my resources like bellow.

 

ResourceName           ExpectedChargeability

     Resource1                          0.9

     resource2                           0.6

     resource3                           0.7

    resource4                            0.5

 

The second table contains data from the timesheets my resources fill.

 

 

 

ResourceName               Capacity            ChargeableWork      week#

     Resource1                        40                           30                     1

     resource2                        40                             36                    1

     resource3                         32                             32                   1

    resource4                          32                             35                    1

     Resource1                        40                           30                     2

     resource2                        40                             36                    2

     resource3                         32                             32                   2

    resource4                          32                             35                    2

 

 

 

 

 

I have calculated the chargebility percentage with the following formula.

 

DIVIDE( SUM([ChargeableWork]) ; SUM([Capacity])) 

 

This formula works fine but I also want to calculate another chargeability percentage that takes into consideration the expected chargeability. Basically I want the same formula as above except I want to also divide by the ExpectedChargability. I tried the following but it didn't work.

 

 

DIVIDE( SUM([ChargeableWork]) ; SUM([Capacity]) * SUM(Table1[ExpectedChargeability]))

 

But it doesn't work. It only works when I select individual resources from a slicer. When there is no filters I get a really small percentage. What's wrong with my formula? I'm using a measure to achieve this.

 

1 ACCEPTED SOLUTION

Sorry I was a bit too fast.. I tried to recreate your model and this formula seem to work for me... My table names might be different than yours...

 

DIVIDE( 
	SUM(Capacity[ChargeableWork]); 
	SUMX(Capacity; CALCULATE( SUM( Capacity[Capacity] ) ) * CALCULATE( SUM( ExpChargeability[ExpChargeability] ) ) ) 
)
/sdjensen

View solution in original post

12 REPLIES 12

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.