Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I'm working on a Power BI matrix where I have two columns in the rows: [Date] from 'TablaCalendario' and [Turnos] from 'Tabla turnos'. In the columns of the matrix, I'm using the [Ingresos] column from 'Tipo de ingresos', which has six values: Perforacion, Horas cliente, Habilitación, Instalación sonda, Equipo bombeo, and Otros.
I've created a measure called "Ingresos Diarios" to calculate the values for the matrix, and it's showing the values correctly. However, the measure is not summing the values by column, only by row. So when I add a Total column, it shows blanks values instead of the correct sum of values.
You can see the next picture as example.
This is the code for the measure "Ingresos diarios"
Ingresos Diarios =
SWITCH (
TRUE (),
HASONEVALUE ('Tipo de ingresos'[Ingresos]),
SWITCH (
SELECTEDVALUE ('Tipo de ingresos'[Ingresos]),
"Perforacion", SUMX ('Curva S', 'Curva S'[Ingreso por ventas]),
"Horas cliente", SUMX ('Hrasfaenas', 'Hrasfaenas'[Ingreso por horas]),
"Habilitación",
SUMX ('LBRDR S42 habilitacion', 'LBRDR S42 habilitacion'[Ingreso por habilitacion real])+
SUMX ('LBRDR habilitacion horas', 'LBRDR habilitacion horas'[Ingreso habilitacion desarrollo + limpieza]),
"Instalación sonda", SUMX ('LBRDR instalacion', 'LBRDR instalacion'[Ingreso por instalacion sonda]),
BLANK()
),
BLANK()
)
Can anyone help me create a measure that will show the row subtotals in the matrix correctly? Thanks in advance for your help!
Solved! Go to Solution.
I found the solution
I found the solution
It didn't work..
It was my fault to explain the problem, it is not the subtotal per row.. it is the subtotal per column where i have the problem, still giving me blanks values.
@Crissceron , Try like
Ingresos Diarios =
Sumx(
values ('Tipo de ingresos'[Ingresos]),
SWITCH (
SELECTEDVALUE ('Tipo de ingresos'[Ingresos]),
"Perforacion", SUMX ('Curva S', 'Curva S'[Ingreso por ventas]),
"Horas cliente", SUMX ('Hrasfaenas', 'Hrasfaenas'[Ingreso por horas]),
"Habilitación",
SUMX ('LBRDR S42 habilitacion', 'LBRDR S42 habilitacion'[Ingreso por habilitacion real])+
SUMX ('LBRDR habilitacion horas', 'LBRDR habilitacion horas'[Ingreso habilitacion desarrollo + limpieza]),
"Instalación sonda", SUMX ('LBRDR instalacion', 'LBRDR instalacion'[Ingreso por instalacion sonda]),
BLANK()
)
)
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
69 |
User | Count |
---|---|
114 | |
100 | |
97 | |
72 | |
68 |