Forum Discussion
Data from a table (count and sum)
Hola @Syndicate_Admin ,
La columna calculada puede obtener directamente el valor actual, pero meausre requiere una función agregada como max() para obtener el valor actual. Por lo tanto, al realizar operaciones de cálculo de grupo, measure debe usar la función max para obtener el valor actual y solo se calcularán los mismos valores juntos.
Saludos
Clara Gong
Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
In my real case, I have the table and the date column is related to a date table.
So should I put this last part like this?
FILTER(ALL(Cab_act_almacen_reg_sql),Cab_act_almacen_reg_sql[Registering Date] = MAX(Fechas[Date]))
Table Cab_act_almacen_reg_sql would be the one for records
Dates[Date] would be the dates related to Cab_act_almacen_reg_sql[Registering Date]
If I do as I attached, the total does not do it correctly, yes by rows but the total does as before.
Here is all my measure:
Measura 2 =
VAR _count = CALCULATE(DISTINCTCOUNT(Cab_act_almacen_reg_sql[Cod_ operario almacen]),FILTER(ALL(Cab_act_almacen_reg_sql),Cab_act_almacen_reg_sql[Registering Date] = MAX(Fechas[Date]))) //Counts the different user codes for the current date
VAR _table = SUMMARIZE(Cab_act_almacen_reg_sql,Cab_act_almacen_reg_sql[Cod_ operario almacen]) // Create virtual table to get table with unique date and user code values
VAR _total_count = COUNTROWS(_table) // Count the number of rows in the virtual table
RETURN
IF(ISINSCOPE(Fechas[Date]),_count,_total_count) // Display different data in layers, date layer and total layer display different counts
Thank you.