Forum Discussion

Aucesar's avatar
Aucesar
Helper III
3 years ago
Solved

DAX Calculation Help

Hi Community another day, another challenge 🙂   Need to acomplish this calculation...thanks for any help in advance!   Date MainWorker Assistant TotalItens DefectoiTens %Defecto Desired...
  • vicky_'s avatar
    3 years ago

    Calculation = 
    var helperTable = UNION(
        SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[MainWorker], "defecto", 'Table'[%Defecto]), 
        SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[Assistant], "defecto", 'Table'[%Defecto])
    )
    return SUMX(FILTER(helperTable, [workers] = SELECTEDVALUE('Table'[MainWorker])), [defecto])

    Hope this helps.