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.
Good afternoon, I'm trying to count days in a row with value 1, but I can't get it right. I've tried things I've seen in the forum but I can't make it work.
Image of how it would be correct:
Thank you, a greeting.
Thank you very much for the help, the problem with the measure you are proposing is that it does not reset for days that have no value.
In the example image you should reset the counter on days 9/01/2021 and 10/01/2021, 13/01/2021 and 14/01/2021 etc..
Really thank you for the help.
Hi, @Syndicate_Admin
You may try the following measure to see if it helps. The pbix file is attached in the end.
Result =
var tab =
SUMMARIZE(
ALLSELECTED(TicajesAcumulado),
TicajesAcumulado[empleado_id],
TicajesAcumulado[PRESENTE],
DimFechas[Fecha]
)
var mindate =
MAXX(
FILTER(
tab,
[empleado_id]=MAX(TicajesAcumulado[empleado_id])&&
[Fecha]<MAX(DimFechas[Fecha])&&
[PRESENTE]<>1
),
[Fecha]
)
return
IF(
MAX(TicajesAcumulado[PRESENTE])=1,
IF(
ISBLANK(mindate),
COUNTROWS(
FILTER(
tab,
[empleado_id]=MAX(TicajesAcumulado[empleado_id])&&
[Fecha]>=mindate&&
[Fecha]<=MAX(DimFechas[Fecha])
)
),
COUNTROWS(
FILTER(
tab,
[empleado_id]=MAX(TicajesAcumulado[empleado_id])&&
[Fecha]>=mindate&&
[Fecha]<=MAX(DimFechas[Fecha])
)
)-1
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Syndicate_Admin , Please check this blog on Continuous-Streak. This for start and end date , but you should be able to manager with 1 date
or
https://stackoverflow.com/questions/57603253/counting-consecutive-fails-in-test-results-in-power-bi
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 |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |