Forum Discussion
navarrobr
10 years agoFrequent Visitor
Calculating Over Time
Hello. I was wondering if someone could help me with the following situation: Imagine that I have a table of hours for employees, like this: name date hours hour type Marcelo 01/05/...
- 10 years ago
Please try to update the measure of Over Time like below.
Over Time = SUMX ( VALUES ( Tabela[date] ), IF ( [Worked Hours] > [Available Hours], [Worked Hours] - [Available Hours], 0 ) )Best Regards,
Herbert
- 10 years ago
Thank you, I used your insight to find a better solution:
Over Time = SUMX ( SUMMARIZE( Tabela[date], Tabela[nome] ), IF ( [Worked Hours] > [Available Hours], [Worked Hours] - [Available Hours], 0 ) )
ankitpatira
10 years agoCommunity Champion
navarrobr what i would do instead is after importing table,
go to power bi desktop query editor
select hours type and hours table and under Transform tab click Pivot Column
pivot it by hours column
Close & Apply
Under modelling tab create new calculated column as below.
=IF( TABLE[worked] > TABLE[available], TABLE[worked] - TABLE[available], 0)
which will give you table as below. then use matrix or table visual to visualise where you can get Totals.