Forum Discussion
Contract hours for each week
Hi,
I have a table like this in Powerbi
| Date | Name | Hours | Contract | Week |
| 8-1-2024 | James | 7,5 | 32 | 1 |
| 9-1-2024 | James | 8 | 32 | 1 |
| 10-1-2024 | James | 3 | 32 | 1 |
| 17-1-2024 | James | 2,7 | 32 | 2 |
| 18-1-2024 | James | 6,5 | 32 | 2 |
| 19-1-2024 | James | 7 | 32 | 2 |
| 20-1-2024 | James | 4,5 | 32 | 2 |
| 30-1-2024 | James | 2,3 | 32 | 3 |
| 31-1-2024 | James | 6,8 | 32 | 3 |
The problem is that the value of "contract" is on every row instead of 1 a week.
This is what I want.
| Date | Name | Hours | Contract | Week |
| 8-1-2024 | James | 7,5 | 32 | 1 |
| 9-1-2024 | James | 8 | 1 | |
| 10-1-2024 | James | 3 | 1 | |
| 17-1-2024 | James | 2,7 | 32 | 2 |
| 18-1-2024 | James | 6,5 | 2 | |
| 19-1-2024 | James | 7 | 2 | |
| 20-1-2024 | James | 4,5 | 2 | |
| 30-1-2024 | James | 2,3 | 32 | 3 |
| 31-1-2024 | James | 6,8 | 3 |
Hope this is possible.
you can can use dax to calculate the sum of contract hours taking into consideration one value :
measure :
Measure = SUMX( SUMMARIZE( tbl_3, tbl_3[Week], tbl_3[Name], tbl_3[Contract] ), tbl_3[Contract] )If my answer helped sort things out for you, i would appreciate a thumbs up π and mark it as the solution β
It makes a difference and might help someone else too. Thanks for spreading the good vibes! π€
4 Replies
- Daniel29195
Community Champion
you can can use dax to calculate the sum of contract hours taking into consideration one value :
measure :
Measure = SUMX( SUMMARIZE( tbl_3, tbl_3[Week], tbl_3[Name], tbl_3[Contract] ), tbl_3[Contract] )If my answer helped sort things out for you, i would appreciate a thumbs up π and mark it as the solution β
It makes a difference and might help someone else too. Thanks for spreading the good vibes! π€- Tinus1905
Resolver I
Daniel29195 ; this works! The only thing is in the matrix report, I have the measure: Test =
SUM('tbl_3[contract])-'measure (is the measure from the solution), the column is empty.- Daniel29195
Community Champion
can you please share a screenshot of what you are encountering ?