Forum Discussion

Santy241's avatar
Santy241
Frequent Visitor
1 year ago
Solved

Column averages in Power BI matrix

Hi community,

I'm working with a matrix visual in Power BI where I calculate the average productivity using a custom measure called Promedio Productividad H 2. As shown in the image below, the row averages (Total column in green) are correctly calculated at each level (Agenda, Contratista, TecnologĂ­a, etc.).

 

Promedio Productividad H 2 =
SWITCH(
TRUE(),
ISINSCOPE(BaseHistorica_Pedidos[Tecnologia]), [Productividad H],
ISINSCOPE(BaseHistorica_Pedidos[Tipo Agenda]),
AVERAGEX(
SUMMARIZE(
BaseHistorica_Pedidos,
BaseHistorica_Pedidos[Contratista],
BaseHistorica_Pedidos[Tecnologia],
BaseHistorica_Pedidos[Tipo Agenda]
),
[Productividad H]
),
AVERAGEX(
SUMMARIZE(
BaseHistorica_Pedidos,
BaseHistorica_Pedidos[Contratista],
BaseHistorica_Pedidos[Tipo Agenda],
BaseHistorica_Pedidos[Tecnologia]
),
[Productividad H]
)
)

 

 

  • Productividad H is calculated as:
    [Finalizados H] / DISTINCTCOUNT(BaseHistorica_Pedidos[Tecnico: Nombre])

  • Finalizados H is also a measure.

 

📌 The problem is:
I also need this same measure to calculate the column averages (e.g., for Day 1, Day 2, etc. as shown in blue). However, the current measure doesn't return the correct values in the column totals. Instead, it seems to sum or behave unexpectedly.

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Santy241,

    May I ask if you have resolved this issue? If not, Kindly provide the sample data so that we can look for a possible solution.

    Thank you.

4 Replies