Forum Discussion

Tinus1905's avatar
Tinus1905
Icon for Resolver I rankResolver I
2 years ago
Solved

Contract hours for each week

Hi,

 

I have a table like this in Powerbi

 

DateNameHoursContractWeek
8-1-2024James7,5321
9-1-2024James8321
10-1-2024James3321
17-1-2024James2,7322
18-1-2024James6,5322
19-1-2024James7322
20-1-2024James4,5322
30-1-2024James2,3323
31-1-2024James6,8323

 

The problem is that the value of  "contract" is on every row instead of 1 a week. 

This is what I want. 

 

DateNameHoursContractWeek
8-1-2024James7,5321
9-1-2024James8 1
10-1-2024James3 1
17-1-2024James2,7322
18-1-2024James6,5 2
19-1-2024James7 2
20-1-2024James4,5 2
30-1-2024James2,3323
31-1-2024James6,8 3

 

Hope this is possible. 

 

  • Tinus1905 

     

    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's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    Tinus1905 

     

    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's avatar
      Tinus1905
      Icon for Resolver I rankResolver 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.