Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to 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:
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 Thanks for your help
DATE | PROCESS_NUMBER | START_PROCESS | END_PROCESS | AMOUNT_PRODUCED |
14/6/2021 | 1 | 08:00:00 | 08:50:00 | 200 |
14/6/2021 | 2 | 09:00:00 | 09:50:00 | 300 |
14/6/2021 | 3 | 10:00:00 | 10:50:00 | 250 |
14/6/2021 | 4 | 11:00:00 | 11:50:00 | 300 |
14/6/2021 | 5 | 12:00:00 | 12:50:00 | 200 |
15/6/2021 | 1 | 08:10:00 | 08:50:00 | 250 |
15/6/2021 | 2 | 09:00:00 | 09:50:00 | 300 |
15/6/2021 | 3 | 10:00:00 | 10:50:00 | 200 |
15/6/2021 | 4 | 11:00:00 | 11:50:00 | 250 |
15/6/2021 | 5 | 12:00:00 | 12:55:00 | 300 |
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:
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/
@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)
= ?
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!!
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |