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

Help creating a measure to subtract the sum of hours from a unique row in another table.

Hello, 

 

I am looking to create a measure to perfrom the following: 

 

The two tables below are linked by "User Name". 

User NameProject NameHours
TimProject 14
TimProject 210
PaulProject 32
PaulProject 48
PaulProject 510

 

User NameAvailable Hours
Tim32
Paul40

 

I need to have a display that calculates as such: 

User NameUsed HoursRemaining Available Hours
Tim1418
Paul2020

 

Essentially the sum of each persons used hours subtracted from thier available total listed in the other table. Thanks. 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @KLGRIZZARD 

Used Hours = SUM ( Table1[Hours] )

 

Remaining Available Hours = 

IF (

    HASONEVALUE ( Table2[Available Hours] ),

    VALUES ( Table2[Available Hours] ) - [Used Hours]

)

 

Then use a matrix visual - Table1or2[User Name] column at the rows and [Remaining Available Hours] measure at the values

 

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @KLGRIZZARD 

Used Hours = SUM ( Table1[Hours] )

 

Remaining Available Hours = 

IF (

    HASONEVALUE ( Table2[Available Hours] ),

    VALUES ( Table2[Available Hours] ) - [Used Hours]

)

 

Then use a matrix visual - Table1or2[User Name] column at the rows and [Remaining Available Hours] measure at the values

 

Samarth_18
Community Champion
Community Champion

Hi @KLGRIZZARD ,

 

Create two measure like below:-

Used Hours = sum(user name[hours])	
Remaining Available Hours = sum(table[available hours]) - sum(user name[hours])

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Thanks, the first measure I can get to work, the second, not so much. 

 

For example sake the tables are named "Project Hours" and "Available Hours" I am not sure how that relates to the second measure. 

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.