Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
Hope someone can help.
I have:
- the next table:
Step | Result | Date | Build |
1 | Failed | 10/02/2021 | A |
1 | Failed | 10/03/2021 | B |
1 | Passed | 11/03/2021 | B |
2 | Failed | 12/03/2021 | B |
2 | Failed | 12/03/2021 | B |
2 | Passed | 10/04/2021 | C |
3 | Passed | 13/04/2021 | C |
3 | Failed | 10/04/2021 | C |
4 | Failed | 11/02/2021 | A |
5 | Passed | 15/02/2021 | A |
5 | Passed | 10/03/2021 | B |
5 | Failed | 10/04/2021 | C |
5 | Failed | 12/04/2021 | C |
6 | Passed | 10/03/2021 | B |
7 | Passed | 12/02/2021 | A |
7 | Failed | 10/03/2021 | B |
7 | Failed | 14/03/2021 | B |
7 | Failed | 16/03/2021 | B |
7 | Passed | 10/04/2021 | C |
8 | Passed | 14/04/2021 | C |
8 | Failed | 16/04/2021 | C |
8 | Failed | 17/04/2021 | C |
8 | Passed | 18/04/2021 | C |
9 | Passed | 10/02/2021 | A |
9 | Failed | 15/02/2021 | A |
9 | Failed | 18/02/2021 | A |
9 | Passed | 11/03/2021 | B |
9 | Passed | 14/03/2021 | B |
9 | Failed | 10/04/2021 | C |
- A slicer with multiselection on Build field.
My goal is to obtain a measure that calculate the last date for a specific step given the slicer selection.
I'm trying with:
Step | Date | Last Date | Build | Result |
1 | 10/02/2021 0:00 | 10/02/2021 0:00 | A | Failed |
1 | 11/03/2021 0:00 | 11/03/2021 0:00 | B | Passed |
1 | 10/03/2021 0:00 | 11/03/2021 0:00 | B | Failed |
When I was waiting:
Step | Date | Last Date | Build | Result |
1 | 10/02/2021 0:00 | 11/03/2021 0:00 | A | Failed |
1 | 11/03/2021 0:00 | 11/03/2021 0:00 | B | Passed |
1 | 10/03/2021 0:00 | 11/03/2021 0:00 | B | Failed |
How can i remove the row context without removing the filter context?
Thanks a lot
Iván
Solved! Go to Solution.
Hi @imoreno ,
Please, try the next measure:
latestDate =
VAR currStep = MAX ( T[Step] )
RETURN
CALCULATE (
MAX ( T[Date] ),
FILTER ( ALLSELECTED ( T ), T[Step] = currStep )
)
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
@imoreno ,
You can try this measure instead:
count =
VAR _t =
FILTER (
ADDCOLUMNS (
SUMMARIZE ( T, T[Step], T[Result], T[Build] ),
"@check",
VAR maxDatePerStep =
CALCULATE ( MAX ( T[Date] ), ALLEXCEPT ( T, T[Step], T[Build] ) )
VAR maxDatePerResult =
CALCULATE ( MAX ( T[Date] ) )
RETURN
maxDatePerStep = maxDatePerResult
),
[@check] = TRUE ()
)
RETURN
COUNTROWS ( _t )
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Great!!
Thank you very much. I've mixed both answers, in order to be able to select more than one build, and it's working perfectly.
Best regards
Iván
Thank you very much, ERD.
It works. I hadn't understood properly the ALLSELECTED context behaviour.
Now i have another context problem:
My goal with this date is to have a measure for counting PASSED / FAILED results, taking into account only the last execution of the selected builds.
I have a new boolean measure which is:
[Last Result] = [Max Date] = [Last Date]
where Max Date = MAX(Executions[Fecha])
It's working ok at row context level.
But when I'm trying to count all the rows on a context with Last Result = TRUE, the context is not taking the Last Date measure properly (or the Max Date or both).
E.g.: With:
Last Result Count = CALCULATE(COUNTROWS(Executions), FILTER(Executions, [Last Result]))
I obtain for A build 3 FAILED and 3 PASSED, when it should be 3 FAILED and 2 PASSED. Moreover, in the previous table, all the rows display Last Result Count as 1, when no all of them have Last Result = True.
I've trying with:
Last Result Count = COUNTROWS(CALCULATETABLE(Executions, FILTER(Executions, Executions[Date] = [Last Date])))
And it's the same result. Also with SUMX...
I'm trying to understand the context properly, but there is something that i'm missing.
Thank you again.
Best regards
@imoreno ,
You can try this measure instead:
count =
VAR _t =
FILTER (
ADDCOLUMNS (
SUMMARIZE ( T, T[Step], T[Result], T[Build] ),
"@check",
VAR maxDatePerStep =
CALCULATE ( MAX ( T[Date] ), ALLEXCEPT ( T, T[Step], T[Build] ) )
VAR maxDatePerResult =
CALCULATE ( MAX ( T[Date] ) )
RETURN
maxDatePerStep = maxDatePerResult
),
[@check] = TRUE ()
)
RETURN
COUNTROWS ( _t )
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi @imoreno ,
Please, try the next measure:
latestDate =
VAR currStep = MAX ( T[Step] )
RETURN
CALCULATE (
MAX ( T[Date] ),
FILTER ( ALLSELECTED ( T ), T[Step] = currStep )
)
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
User | Count |
---|---|
47 | |
26 | |
22 | |
17 | |
15 |
User | Count |
---|---|
53 | |
34 | |
17 | |
17 | |
15 |