Forum Discussion

MLax's avatar
MLax
New Member
3 years ago
Solved

Time sum per row then column

Please help! I have tried so many different formulas and cant get it to work. Time calculation in DAX is complicated.    I have a file that contains multiple elapsed times for the same user. Here i...
  • bolfri's avatar
    bolfri
    3 years ago

    Solution #1: Power Query M (I can show you how)

    If you want, I can prepare a solution in Power Query M, so you will recive same information without loading every row in the Power BI (recommended), but if you need every row for some reason then go for solution 2.


    Solution #2: DAX Calculated Table

     

    Sample Agg = 
    SUMMARIZE(
        'Sample',
        'Sample'[User Name],
        "Elapsed Time", SUM('Sample'[NP Elapsed Time]),
        "Elapsed Time Other", SUM('Sample'[NP Elapsed Time Other]),
        "Total time", SUM('Sample'[NP Elapsed Time]) + SUM('Sample'[NP Elapsed Time Other])
    )

     

    Don't forget to change this columns from datetime to time only. 🙂

     

     

    Solution #3: Measures

    If you don't want to create a new table. Only calculate values from the oryginal one - use measures.

     

    Elapsed Time = SUM('Sample'[NP Elapsed Time])
    Elapsed Time Other = SUM('Sample'[NP Elapsed Time Other])
    Elaped Time Total = [Elapsed Time] + [Elapsed Time Other]

     

    Don't forget to format this measures to time format. 🙂