Forum Discussion

zahrabajgiran's avatar
zahrabajgiran
Regular Visitor
3 years ago
Solved

using average and SUM

INVOICE STEP INVOICEDATE TASKENDTIME DAYSSPENT 22093C Process Invoice 2022-04-29 41:00.0 5 22093C Super Approval 2022-04-29 14:00.0 37 22093C GL Stamp Job/Subcontractor 2022...
  • barritown's avatar
    3 years ago

    Hi zahrabajgiran,

    If the columns on the screenshot above match your expectations, you can achieve such results using two similar calculated columns:

    SUM_DAYSSPENT = 
    VAR CurrentInvoice = [INVOICE]
    RETURN SUMX ( FILTER ( ALL(data), [INVOICE] = CurrentInvoice ), [DAYSSPENT] )
    
    AVG_DAYSSPENT = 
    VAR CurrentInvoice = [INVOICE]
    RETURN AVERAGEX ( FILTER ( ALL(data), [INVOICE] = CurrentInvoice ), [DAYSSPENT] )

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian