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

Calculate difference using minimum values

I'm trying to establish a value for whether someone underused or overused hours allocated to a project. For instance, Tom Smith wasn't forcasted to work on 3/4/2024, so he was over $80.40. On 3/19 Nick Roth was forecasted to work 13 hours but actually worked 0.5, therefore underutilizing $314.88 of billable work.

 

My issue comes with a function from the raw data I cannot change. When someone has 0 approved hours, it defaults to an exhorborant number (again, something I cannot change). This is particulary challenging because if someone is forecasted to work and then doesn't, it's a missed opportunity to bill hours (see 3/11/2024). 

 

My solution to this was to just use the minimum value in the Rate column per User. I tried making a separate calculated table with the User where it had their name and their minimum rate, which gave me a table with those values, but I was unable to calculate that Billing Delta column. 

 

Any other ideas? Thank you! 

mikesdunbar_0-1729527437340.png


Here's the table data.

DateFilterProjectUser Rate  Forceasted hoursActual hoursForecasted Billing AmountActual billed amountBilling Delta
3/4/20241.00Tunnel PaintTom Smith $                     20.1004$80.40$80.40-$80.40
3/4/20241.00Tunnel PaintGeorge Green $  214,748,364.7000$0.00$0.00$0.00
3/11/20241.00Tunnel PaintNick Roth $  214,748,364.7010.880$0.00$0.00$2,336,462,207.94
3/11/20241.00Tunnel PaintTom Smith $  214,748,364.705.040$0.00$0.00$1,082,331,758.09
3/11/20241.00Tunnel PaintGeorge Green $  214,748,364.7000$0.00$0.00$0.00
3/11/20241.00Tunnel PaintErin Erickson $  214,748,364.7000$0.00$0.00$0.00
3/18/20241.00Tunnel PaintNick Roth $                     24.6013.30.5$12.30$12.30$314.88
3/18/20241.00Tunnel PaintTom Smith $                     20.106.1610$10.05$10.05-$77.18
3/25/20241.00Tunnel PaintNick Roth $                     24.6010.880.75$18.45$18.45$249.20
3/25/20241.00Tunnel PaintTom Smith $  214,748,364.705.040$0.00$0.00$1,082,331,758.09
10/28/20241.00Tunnel PaintNick Roth $  214,748,364.705.280$130.38$0.00$1,133,871,365.62
10/28/20241.00Tunnel PaintTom Smith $  214,748,364.7000$0.00$0.00$0.00
11/4/20241.00Tunnel PaintNick Roth $  214,748,364.704.320$106.60$0.00$927,712,935.50
11/4/20241.00Tunnel PaintTom Smith $  214,748,364.7000$0.00$0.00$0.00
11/11/20241.00Tunnel PaintNick Roth $  214,748,364.705.280$130.38$0.00$1,133,871,365.62
11/11/20241.00Tunnel PaintTom Smith $  214,748,364.7000$0.00$0.00$0.00
11/11/20241.00Tunnel PaintGeorge Green $  214,748,364.7000$0.00$0.00$0.00
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mikesdunbar ,
In Power BI Desktop, you can create calculated column to achieve this

Actual Rate = 
CALCULATE(
    MIN('Table'[Rate]),
    ALLEXCEPT(
        'Table',    
        'Table'[User]
    )
)
Billing Delt Rate = ('Table'[Forceasted hours] - 'Table'[Actual hours]) * 'Table'[Actual Rate]

Fina output

vheqmsft_0-1729562755789.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

In another column, show the expected result very clearly and also the method of calculation.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @mikesdunbar ,
In Power BI Desktop, you can create calculated column to achieve this

Actual Rate = 
CALCULATE(
    MIN('Table'[Rate]),
    ALLEXCEPT(
        'Table',    
        'Table'[User]
    )
)
Billing Delt Rate = ('Table'[Forceasted hours] - 'Table'[Actual hours]) * 'Table'[Actual Rate]

Fina output

vheqmsft_0-1729562755789.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

lbendlin
Super User
Super User

some would say exorbitant, others would recognize a buffer overrun (2 to the Power of 31 minus 1, divided by 10 for some reason).  Might want to replace that value with null.

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.