Forum Discussion
Calculate Minimum Payment per Hour
- 9 years ago
Hey,
I'm not sure if I totally understand your requirement, but here you'll find a little pbix file
I created two calculated columns and one measure
Worked Units - this columns sums the units per Worker | Day | Hour
Worked Units = CALCULATE( SUM('Table1'[Units]) ,ALLEXCEPT('Table1',Table1[Worker ID],'Table1'[Day],Table1[Reporting Hour]) )I changed the default aggregation to Average.
The 2nd calculated column just calculates the extra payment. This column is hidden from the Report View
The Measure "Extra Payment" calculates the measure that is applicable for each worker | day | hour
Extra Payment = CALCULATE( SUMX( SUMMARIZE('Table1',Table1[Worker ID],Table1[Day],Table1[Reporting Hour],"ExtraPayement", AVERAGE(Table1[Extra Payments])) ,[ExtraPayement]) )This measure aggregates the calculated column "Extra Payment" using the AVERAGE() function.
This is inside the SUMX() so that Worker 1 has an Extra Payment of 7, 3 from working hour 15 and 4 from workig hour 16.
Hope this is what you are looking for
Regards
Hey,
I'm not sure if I totally understand your requirement, but here you'll find a little pbix file
I created two calculated columns and one measure
Worked Units - this columns sums the units per Worker | Day | Hour
Worked Units =
CALCULATE(
SUM('Table1'[Units])
,ALLEXCEPT('Table1',Table1[Worker ID],'Table1'[Day],Table1[Reporting Hour])
) I changed the default aggregation to Average.
The 2nd calculated column just calculates the extra payment. This column is hidden from the Report View
The Measure "Extra Payment" calculates the measure that is applicable for each worker | day | hour
Extra Payment =
CALCULATE(
SUMX(
SUMMARIZE('Table1',Table1[Worker ID],Table1[Day],Table1[Reporting Hour],"ExtraPayement", AVERAGE(Table1[Extra Payments]))
,[ExtraPayement])
)This measure aggregates the calculated column "Extra Payment" using the AVERAGE() function.
This is inside the SUMX() so that Worker 1 has an Extra Payment of 7, 3 from working hour 15 and 4 from workig hour 16.
Hope this is what you are looking for
Regards
- fturmo9 years agoFrequent Visitor
Thanks Tom for your suggestion it works perfectly.
Francesc.