Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone!
I'm new to Power BI!
I'm trying to create a "binary" column that should set the value 1 if two conditions are present simultaneously: the period is overlapped to others in the table (ex. row 1 and 6) and the production period in that row is longer.
As an example of my data.
Machinery | Date | Start_prod | End_prod | Minuts_prod | Check Overlap |
A | 01/02/2019 | 01/02/2019 08:00 | 01/02/2019 09:10 | 70 | 1 |
A | 01/02/2019 | 01/02/2019 09:00 | 01/02/2019 09:10 | 10 | 0 |
B | 01/02/2019 | 01/02/2019 08:00 | 01/02/2019 12:00 | 240 | 0 |
B | 01/02/2019 | 01/02/2019 13:00 | 01/02/2019 14:00 | 60 | 0 |
A | 01/02/2019 | 01/02/2019 12:00 | 01/02/2019 13:00 | 60 | 0 |
A | 02/02/2019 | 02/02/2019 08:00 | 02/02/2019 09:10 | 70 | 1 |
A | 02/02/2019 | 02/02/2019 08:30 | 02/02/2019 09:10 | 40 | 0 |
Can you help me please? Thanks in advance!
Solved! Go to Solution.
Autofind solution 🙂
Period Overlap =
VAR Overlapped =
COUNTROWS(
FILTER(
ALL(Table);
Table[Start_prod] <= EARLIER(Table[Start_prod]) &&
Table[End_prod] >= EARLIER(Table[End_prod]) &&
Table[Date] = EARLIER(Table[Date]) &&
Table[Machinery] = EARLIER(Table[Machinery]) &&
Table[Id] <> EARLIER(Table[Id])
)
)
RETURN
IF(Overlapped; "YES"; "NO")
Autofind solution 🙂
Period Overlap =
VAR Overlapped =
COUNTROWS(
FILTER(
ALL(Table);
Table[Start_prod] <= EARLIER(Table[Start_prod]) &&
Table[End_prod] >= EARLIER(Table[End_prod]) &&
Table[Date] = EARLIER(Table[Date]) &&
Table[Machinery] = EARLIER(Table[Machinery]) &&
Table[Id] <> EARLIER(Table[Id])
)
)
RETURN
IF(Overlapped; "YES"; "NO")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |