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
jsangerman
Helper I
Helper I

Sum minus value from related table

I have two tables:

 

People

PersonCapacity
John1
Mike0.8
Alice0.4

 

Utilization

PersonPeriodProjectUtilization
John10/1/2021Project 10.5
John10/1/2021Project 20.4
John11/1/2021Project 11
Alice10/1/2021Project 20.5

 

I'm trying to calculate the available capacity for each person (rows) for each period (columns), equal to the capacity of the person minus the sum of the utilization for the period. The result I'm looking for is this table:

Person10/1/202111/1/2021
John0.10
Alice-0.10.4
Mike0.80.8

 

What DAX formula gets me there?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jsangerman , Try one of the two measures

 


Sum(people[Capacity]) - sum(Utilization[Utilization])

 

or

 

Sumx(summarize(Utilization, people[person], people[Capacity], Utilization[Period], "_1", sum(Utilization[Utilization])), [Capacity] -[_1])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@jsangerman , Try one of the two measures

 


Sum(people[Capacity]) - sum(Utilization[Utilization])

 

or

 

Sumx(summarize(Utilization, people[person], people[Capacity], Utilization[Period], "_1", sum(Utilization[Utilization])), [Capacity] -[_1])

The second option is exactly what I needed, and I understand how it works. You're using SUMMARIZE to create a new table with 1 value for Capacity plus the sum of Utilization for a given person and period. The math is simple from there.

 

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.

Top Solution Authors