Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Rpoucas
Frequent Visitor

How to get a sum of process times when filtering two or more data?

When performing a filter and selecting the dates 06/14/2021 and 6/15/2021, I need to add the interval between the start time and end time of the two dates.

Putting it another way:

maximum hours (06/14/2021) - minimum hours (06/14/2021)

+

maximum time (06/15/2021) - minimum time (06/15/2021)

= ?

The objective is to obtain the production time per day and accumulated when more than one date is filtered.

 

bidaniel.jfif

1 ACCEPTED SOLUTION

Hi @Rpoucas 

 

Try this measure:

Production Time = 
VAR _A = 
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[DATE],
            "Start", MIN ( 'Table'[START_PROCESS] ),
            "End", MAX ( 'Table'[END_PROCESS] )
        ),
        "Production time", [End] - [Start]
    )
RETURN
    SUMX ( _A, [Production time] )

Output:

VahidDM_0-1636587049962.png

Download File: https://gofile.io/d/qJ1w3w

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!


LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

6 REPLIES 6
Rpoucas
Frequent Visitor

@VahidDM Thanks for your help

 

DATEPROCESS_NUMBERSTART_PROCESSEND_PROCESSAMOUNT_PRODUCED
14/6/2021108:00:0008:50:00200
14/6/2021209:00:0009:50:00300
14/6/2021310:00:0010:50:00250
14/6/2021411:00:0011:50:00300
14/6/2021512:00:0012:50:00200
15/6/2021108:10:0008:50:00250
15/6/2021209:00:0009:50:00300
15/6/2021310:00:0010:50:00200
15/6/2021411:00:0011:50:00250
15/6/2021512:00:0012:55:00300

@smpa01  @VahidDMmaximum hours END_PROCESS (06/14/2021) - minimum hours START_PROCESS (06/14/2021) = 12:50:00 - 08:00:00 = 04:50:00

maximum time END_PROCESS(06/15/2021) - minimum time START_PROCESS(06/15/2021)  = 12:55:00 - 08:10:00 = 04:45:00

... 04:50:00 + 04:45:00 =  09:35:00
 - 

Hi @Rpoucas 

 

Try this measure:

Production Time = 
VAR _A = 
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[DATE],
            "Start", MIN ( 'Table'[START_PROCESS] ),
            "End", MAX ( 'Table'[END_PROCESS] )
        ),
        "Production time", [End] - [Start]
    )
RETURN
    SUMX ( _A, [Production time] )

Output:

VahidDM_0-1636587049962.png

Download File: https://gofile.io/d/qJ1w3w

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!


LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

@VahidDM Thank you very much, it worked perfectly.

@Rpoucas  are you able to show the desired output for the above data that would follow the logic below

 

maximum hours (06/14/2021) - minimum hours (06/14/2021)

+

maximum time (06/15/2021) - minimum time (06/15/2021)

= ?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
VahidDM
Super User
Super User

HI @Rpoucas 

 

Can you share a sample of your data in the table format to be able to copy and past that?

 

Appreciate your Kudos!!

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.