Forum Discussion

mikesdunbar's avatar
mikesdunbar
Helper I
1 year ago
Solved

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! 


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
  • Anonymous's avatar
    Anonymous
    1 year ago

    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

     

    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

     

3 Replies

  • 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.

  • Anonymous's avatar
    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

     

    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

     

  • Hi,

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