Forum Discussion
Re: Calculate timedifference between slicer which contains 2 rows of data
Hi Anonymous ,
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Neeko Tang
2 Replies
- AnonymousNot applicable
Hi Anonymous,
as it is not possible to send you the data I will make pictures and tables:
Modell is the following:All Tickets Table:
Is merge of closed and opened Tickets and connected to other table via tickets
All Orders Table:
Is merge of closed an opened orders and connected to other table via orders
Date Table:Normal Date Table with dates etc.
Closed Orders Table:
Start of order End of order Order Code Ticket Code Equipment Machine Failure Failure Time 27.06.2023 22.07.2023 10008 7 400001 No 0 25.12.2023 28.12.2023 10011 8 400021 Yes 12 10.11.2023 18.12.2023 10021 9 400111 Yes 0 10.08.2023 20.08.2023 10033 10 400334 No 0 01.01.2023 01.01.2023 10035 11 400245 Yes 8 23.12.2023 29.12.2023 10012 8 400021 Yes 12 01.07.2023 15.07.2023 10015 7 400001 No 0 Open Orders Table:
Start of order Order Code Ticket Code Equipment Machine Failure Failure Time 01.03.2024 10001 1 400001 No 0 05.01.2024 10002 2 400022 Yes 5 10.01.2024 10005 3 400102 No 0 15.01.2024 10007 4 400304 Yes 10 03.01.2024 10020 2 400022 Yes 5 Closed Tickets Table:
Start of malfunction End of malfunction Ticket Code Order Code Equipment Machine Failure Failure Time 25.06.2023 28.07.2023 7 10008 400001 No 0 22.12.2023 30.12.2023 8 10011 400021 Yes 12 10.11.2023 20.11.2023 9 10021 400111 Yes 0 08.08.2023 10.08.2023 10 10033 400334 No 0 01.01.2024 02.01.2024 11 10035 400245 Yes 8
Open Tickets Table:Start of malfunction
Ticket Code Order Code Equipment Machine Failure Failure Time 01.01.2024 1 10001 400001 No 0 02.01.2024 2 10002 400022 Yes 5 10.01.2024 3 10005 400102 No 0 12.01.2024 4 10007 400304 Yes 10 15.01.2024 5 10010 400256 Yes 7 - AnonymousNot applicable
Hi Anonymous ,
We can create a date table as a slicer. Note that this date table does not have any modeling relationship with the other tables.
Date Table = CALENDAR(Date(2023,1,1),Date(2024,12,31))We can create measures.
Flag = IF( MAX('Closed Orders Table'[Start of order]) >= MIN('Date Table'[Date]) && MAX('Closed Orders Table'[Start of order]) <= MAX('Date Table'[Date]),1,0)Flag2 = IF( MAX('Open Orders Table'[Start of order]) >= MIN('Date Table'[Date]) && MAX('Open Orders Table'[Start of order]) <= MAX('Date Table'[Date]),1,0)Flag3 = IF( MAX('Closed Tickets Table'[Start of malfunction]) >= MIN('Date Table'[Date]) && MAX('Closed Tickets Table'[Start of malfunction]) <= MAX('Date Table'[Date]),1,0)Flag4 = IF( MAX('Open Tickets Table'[Start of malfunction]) >= MIN('Date Table'[Date]) && MAX('Open Tickets Table'[Start of malfunction]) <= MAX('Date Table'[Date]),1,0)Place [Flag=1] on visual object screening .
If this doesn't help, give your expected results.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.