Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RTERCERO
Helper I
Helper I

Measure sums for categories but not for total

Hello,

 

I have a measure that present calculations properly when in separate visuals but when in the same one does not sum properly:

 

The calculations to match in separate graphs, (see red rectangle), and when I place then in the same table individual values add perfectly but totals just in  "Horas Jornada" which is man hours per shift do not (see yellow rectangle should be "129,720"):

 

RTERCERO_0-1628006897748.png

 

This is the formula I use for "Horas Jornada" (man hours per shift) :

Horas de Jornada = 
    COUNTROWS('Calendario de Grupos')*
    CALCULATE([Activos X Fecha],FIRSTNONBLANK('Calendario de Grupos'[Grupo],'Calendario de Grupos'[Grupo]))
    *12

 

Second Isue is when I try to filter by Business unit Absent hours disappear (red rectangles):

RTERCERO_1-1628006897791.png

 

These are the relations:

RTERCERO_3-1628007338375.png

 

Tables explanation:

"Masestro_empleados" is the list of all employees active and inactive with the date of hiring and retired date, I use this to calculate how many active we have each day, the formulas is Active per date:

Activos X Fecha = 

      CALCULATE(COUNTROWS(
    CALCULATETABLE('maestro_empleados (Ausentismo)',
    FILTER('maestro_empleados (Ausentismo)',
    'maestro_empleados (Ausentismo)'[FECHA INGRESO]<=MAX('Calendario de Grupos'[Fecha])
    && 'maestro_empleados (Ausentismo)'[ESTADO]="A"))))
+
    CALCULATE(COUNTROWS(
    CALCULATETABLE('maestro_empleados (Ausentismo)',
    FILTER('maestro_empleados (Ausentismo)',
    'maestro_empleados (Ausentismo)'[FECHA INGRESO]<=MAX('Calendario de Grupos'[Fecha])
    &&'maestro_empleados (Ausentismo)'[FECHA RETIRO]<>BLANK()
    &&'maestro_empleados (Ausentismo)'[FECHA RETIRO]>=MIN('Calendario de Grupos'[Fecha])
    && 'maestro_empleados (Ausentismo)'[ESTADO]="R"))))

 

"Calendario Grupos" its the team and shift information for each date, This is not my main calendar, there are other tables in the complete model that have a relation to the actual man calendar which is: "Calendario"

 

"Ausentismo Manual" is the absenteeism registry, who was absent how many hours and when

 

"UNIDADES" is a table to group business units according to leader

 

"Grupo Texto" is a table with the team names that i used to remove the many to many relationship Between "Calendario" and "Maestro_empleados"

 

 

I'm attaching the model : 
https://we.tl/t-jcK1Uv490D

 

RT

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RTERCERO,

I think these should relate to the nested basic measure. AFAIK, the measure formula is calculated on row content and you can use one function to extract the current row contents. These functions' results will be changed when you use them on different row content levels.

For this scenario, you can try to write a variable with summarize function to manually keeping raw content contents aggeration. Then you can use iterator functions on them to summary these results.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @RTERCERO,

I think these should relate to the nested basic measure. AFAIK, the measure formula is calculated on row content and you can use one function to extract the current row contents. These functions' results will be changed when you use them on different row content levels.

For this scenario, you can try to write a variable with summarize function to manually keeping raw content contents aggeration. Then you can use iterator functions on them to summary these results.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.