Forum Discussion

James_Galis1's avatar
James_Galis1
Helper II
3 years ago
Solved

Sum max value

Hello

 

Hoping to get some assistance with a measure that adds up the value in the " Free time" column for each given date.

 

I use a date slicer which could show x number of days, weeks etc

 

The free time column represents available time for each respective date but should not be summing up all the values as it would give an inaccurate total of free time. Needing to add just 1 value from the " Free time" column for each date

 

The data is represented as follows:

 

Employee Start DateStart TimeEnd TimeFree Time
Emp 103/07/2023 07:00:008:00:002
Emp 103/07/2023 08:30:00 09:30:002
Emp 103/07/202310:00:00 11:30:002
Emp 103/07/2023 11:45:00 13:45:002
Emp 103/07/2023 14:30:0016:30:002
Emp 105/07/2023 08:30:00 09:30:001.75
Emp 105/07/2023 10:00:00 11:00:001.75
Emp 105/07/2023 11:30:00 13:30:001.75
Emp 105/07/202314:00:00 15:30:001.75
Emp 105/07/2023 15:45:00 17:45:001.75
Emp 104/07/2023 08:30:00 09:30:001.5
Emp 104/07/2023 09:45:00 10:45:001.5
Emp 104/07/2023 11:15:00 12:45:001.5
Emp 104/07/2023 13:00:00 14:00:001.5
Emp 104/07/2023 14:30:00 16:30:001.5

 

The expected results for each date would be

 

3/7/23 = 2

4/7/23 = 1.75

5/7/23 = 1.5

 

Total = 4.75

 

Would like to show the "Total" value on a card if possible

 

I have tried a number of solutions  but given that values for each date are the same any calculation seems to be adding up all the values for the respective date 

 

Appreciate the assistance

 

 

  • You might try:

    SUMX(
        SUMMARIZE('Table','Table'[Start Date], 'Table'[Free Time]), [Free Time])



6 Replies

  • eliasayyy's avatar
    eliasayyy
    Memorable Member

    you can use sumx function

    sumx(values([date]),max([amount]))

    • James_Galis1's avatar
      James_Galis1
      Helper II

      Hi

       

      It does not seem to add up correctly

       

      I get a total of 6 when looking at the data above

  • You might try:

    SUMX(
        SUMMARIZE('Table','Table'[Start Date], 'Table'[Free Time]), [Free Time])