Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Workleave.id | Previouschainedworkleave.id | path | Duration | Total duration |
111 | 111 | 1 | 1 | |
222 | 111 | 111 | 222 | 1 | 2 |
333 | 222 | 111|222|333 | 1 | 3 |
444 | 444 | 1 | 1 | |
555 | 555 | 1 | 1 |
but the correct end result would be
Workleave.id | Previouschainedworkleave.id | path | Duration | Total duration |
111 | 111 | 1 | 3 | |
222 | 111 | 111 | 222 | 1 | 0 |
333 | 222 | 111|222|333 | 1 | 0 |
444 | 444 | 1 | 1 | |
555 | 555 | 1 | 1 |
Solved! Go to Solution.
Hi @henkka,
I'd propose to solve you problem with a calculation column like this:
And in the text format for convenience:
Total duration =
VAR CurrentWorkLeaveID = [Workleave.id]
RETURN SUMX (
FILTER (
ADDCOLUMNS ( ALL ( FactWorkleaves ),
"Flag",
FIND ( CurrentWorkLeaveID, [path], 1, BLANK () ) = 1 ),
[Flag] = TRUE () ),
[Duration] ) + 0
Best Regards,
Alexander
Hi @henkka,
I'd propose to solve you problem with a calculation column like this:
And in the text format for convenience:
Total duration =
VAR CurrentWorkLeaveID = [Workleave.id]
RETURN SUMX (
FILTER (
ADDCOLUMNS ( ALL ( FactWorkleaves ),
"Flag",
FIND ( CurrentWorkLeaveID, [path], 1, BLANK () ) = 1 ),
[Flag] = TRUE () ),
[Duration] ) + 0
Best Regards,
Alexander
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
98 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |