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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JoeKat07
Frequent Visitor

Calculating total hours over a threshold

Im trying to find if there are time entries that add up to going over an allotted amount of time (threshold). ive calculated the total hours of the projects by using a measure with the equation TotalHours = sum('Test Table'[Hours]). I need to show the calculate the difference between the two values. Here is the table i'm working with.

 

 

image.png

 

Thanks!!!

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @JoeKat07,

Based on my understanding, please follow the steps and check if it meets your requirement.

1. You can create a new table using SUMMARIZE function by New Table under Modeling on home page->type the following formula.

Table = SUMMARIZE(Test,Test[Project Id],"TotalHours",SUM(Test[Threshold]))


2. Create the calculated columns using the formulas.

previous row = LOOKUPVALUE('Table'[TotalHours],'Table'[Project Id],'Table'[Project Id]-1)

difference = 'Table'[TotalHours]-'Table'[previous row]

1.PNG

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Here is my suggestion.  Create a Matrix Visual.  Put your project ID onto the Rows and create this measure which will be your "Values".  Then filter out when Values is less or equal to 0.

 

Hours over =  MEDIAN('YourTable'[Threshold]) - SUM('Your Table'[Hours])
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @JoeKat07,

Based on my understanding, please follow the steps and check if it meets your requirement.

1. You can create a new table using SUMMARIZE function by New Table under Modeling on home page->type the following formula.

Table = SUMMARIZE(Test,Test[Project Id],"TotalHours",SUM(Test[Threshold]))


2. Create the calculated columns using the formulas.

previous row = LOOKUPVALUE('Table'[TotalHours],'Table'[Project Id],'Table'[Project Id]-1)

difference = 'Table'[TotalHours]-'Table'[previous row]

1.PNG

Best Regards,
Angelia

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors