Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

Sum per Week and Location

Hi can any one help me on my calculated column and also for measure. on my table i want the sum of countMax per week

Week 35: Sum Max= 254 which is from (159 + 13 + 82)

Week 35: Sum Max= 214 which is from (86 + 110 + 18)

 

and fro Sum MaxandLocation/Vessel
Week 35: 241 which is from Location South and 159 + 82
Week 35: 82 which is from Location East and 82, no other East value on week 35

Week 35: 13 which is from Location North and 13, no other North value on week 35

Same on Week 34

 

DESIRED OUTPUT

DATELocation/VesselWeek No:CountMAXSum MaxSum MaxandLocation/Vessel
8/25/2025South35159254241
8/25/2025South35159  
8/25/2025South35159  
8/25/2025North3513 13
8/26/2025North3513  
8/27/2025North3513  
8/29/2025East3582 82
8/29/2025South3582  
8/29/2025East3582  
8/29/2025East3582  
8/29/2025East3582  
8/21/2025East3486214104
8/21/2025East3486  
8/21/2025East3486  
8/21/2025East3486  
8/21/2025East3486  
8/18/2025West34110 128
8/18/2025West34110  
8/18/2025West34110  
8/18/2025West34110  
8/18/2025West34110  
8/22/2025East3418  
8/22/2025North3418 18
8/22/2025North3418  
8/23/2025North3418  
8/18/2025West3418  
8/18/2025North3418  
8/18/2025North3418  
  • Hi AllanBerces 

    Are you sure you want calculated colums? You'll have to have a criteria which row to applied the sum of max but as measures, try these:

    Sum of Max = 
    SUMX (
        SUMMARIZECOLUMNS (
            'Table'[Week No:],
            'Table'[Location/Vessel],
            "@max", CALCULATE ( MAX ( 'Table'[CountMAX] ) )
        ),
        [@max]
    )
    
    Sum of MaxandLocation/Vessel = 
    SUMX (
        SUMMARIZECOLUMNS (
            'Table'[Week No:],
            'Table'[Location/Vessel],
            'Table'[CountMAX]     
        ),
        [CountMAX]
    )
    

     

2 Replies

  • Hi AllanBerces 

    Are you sure you want calculated colums? You'll have to have a criteria which row to applied the sum of max but as measures, try these:

    Sum of Max = 
    SUMX (
        SUMMARIZECOLUMNS (
            'Table'[Week No:],
            'Table'[Location/Vessel],
            "@max", CALCULATE ( MAX ( 'Table'[CountMAX] ) )
        ),
        [@max]
    )
    
    Sum of MaxandLocation/Vessel = 
    SUMX (
        SUMMARIZECOLUMNS (
            'Table'[Week No:],
            'Table'[Location/Vessel],
            'Table'[CountMAX]     
        ),
        [CountMAX]
    )