Forum Discussion

kostask's avatar
kostask
Helper II
3 years ago
Solved

Sumarrizing problem

Hi guys!

I have a table (Production)  in which there is the daily production of the company's personnel. Above a production limit, a productivity bonus is given. The logic is simple:

DayBonus = IF(SUM(Production[Production])>=[ProductionTarget],10, BLANK())
So, the result on a table seems like this:
The row headers describe the employee number and the column headers, the date.
Dates come from a separate Date table. Employees' numbers exist only in the main table (Production)
How can I modify my formula to get the right summarized total results by row and by column?
Thank you
Kostas
  • Try

    Bonus =
    VAR SummaryTable =
        ADDCOLUMNS (
            SUMMARIZE ( 'Production', 'Production'[Employee ID], 'Date'[Date] ),
            "@value",
                IF (
                    CALCULATE ( SUM ( 'Production'[Production] ) ) >= [ProductionTarget],
                    10,
                    BLANK ()
                )
        )
    RETURN
        SUMX ( SummaryTable, [@value] )
    

2 Replies

  • Try

    Bonus =
    VAR SummaryTable =
        ADDCOLUMNS (
            SUMMARIZE ( 'Production', 'Production'[Employee ID], 'Date'[Date] ),
            "@value",
                IF (
                    CALCULATE ( SUM ( 'Production'[Production] ) ) >= [ProductionTarget],
                    10,
                    BLANK ()
                )
        )
    RETURN
        SUMX ( SummaryTable, [@value] )