The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I ma trying to use COUNTAX for the first time but I ma getting the following error:
The end of the input was reached
The goal of this formula is to determine the turn (either "Diurno" or "Nocturno") for a given date and operator, based on the number of tasks assigned to that operator for that date.
Then, the formula uses the "IF" function to compare the count of tasks assigned to the operator for a given date, where the turn is "Diurno", to the count of tasks assigned to the operator for the same date, where the turn is "Nocturno Mañana" or "Nocturno Tarde".
If the count of tasks assigned for the "Diurno" turn is greater than the count of tasks assigned for the "Nocturno Mañana" or "Nocturno Tarde" turn, the formula returns "Diurno". Otherwise, it returns "Nocturno".
In summary, the formula calculates the number of tasks assigned to a specific operator for a given date, and based on this count, returns the turn (either "Diurno" or "Nocturno") for that operator on that date.
Does anyone has an idea of where the error can be from?
Solved! Go to Solution.
Hi !
Unfortunately it did not work but I find a solution that I post below in case someone might need it. Thank you !
Instead of COUNTAX and VAR I used EARLIER():
COUNTROWS(
FILTER(
TareasXOperariosXCias,
EARLIER(TareasXOperariosXCias[UNIDAD_TEMPORAL])=TareasXOperariosXCias[UNIDAD_TEMPORAL]
&&
EARLIER(TareasXOperariosXCias[OPERARIO])=TareasXOperariosXCias[OPERARIO]
&&
EARLIER(TareasXOperariosXCias[Actividad])=TareasXOperariosXCias[Actividad]
&&
TareasXOperariosXCias[TURNO_DETALLADO] = "Nocturno Mañana"
)
)
Maybe parenthesis almost in the end after
Nocturno Tarde")
Turno =
VAR curFecha = TareasXOperariosXCias[Fecha real]
var curOperario = TareasXOperariosXCias[OPERARIO]
RETURN
IF(
CALCULATE(
COUNTAX(
TareasXOperariosXCias,
FILTER(
TareasXOperariosXCias,
curFecha = TareasXOperariosXCias[Fecha real]
&&
curOperario = TareasXOperariosXCias[OPERARIO]
&&
(TareasXOperariosXCias[TURNO_DETALLADO] = "Diurno")
)
)
)
>
CALCULATE(
COUNTAX(
TareasXOperariosXCias,
FILTER(
TareasXOperariosXCias,
curFecha = TareasXOperariosXCias[Fecha real]
&&
curOperario = TareasXOperariosXCias[OPERARIO]
&&
(TareasXOperariosXCias[TURNO_DETALLADO] = "Nocturno Mañana" || TareasXOperariosXCias[TURNO_DETALLADO] = "Nocturno Tarde")
)
)
),
"Diurno",
"Nocturno"
)
Hi !
Unfortunately it did not work but I find a solution that I post below in case someone might need it. Thank you !
Instead of COUNTAX and VAR I used EARLIER():
COUNTROWS(
FILTER(
TareasXOperariosXCias,
EARLIER(TareasXOperariosXCias[UNIDAD_TEMPORAL])=TareasXOperariosXCias[UNIDAD_TEMPORAL]
&&
EARLIER(TareasXOperariosXCias[OPERARIO])=TareasXOperariosXCias[OPERARIO]
&&
EARLIER(TareasXOperariosXCias[Actividad])=TareasXOperariosXCias[Actividad]
&&
TareasXOperariosXCias[TURNO_DETALLADO] = "Nocturno Mañana"
)
)
User | Count |
---|---|
14 | |
12 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
7 | |
5 |