Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Comunidad, estoy desconcertado por qué mi código variable no está funcionando como está programado para. Vea el Excel adjunto con explicación. Básicamente, mi primera página se muestra muy bien, pero la segunda página está exlcudando uno de los campos.
El código real:
VariableMeasureValue á IF(MAX(dim_Column[Report_column_name])-"C_electric_previous" , (SUM('fact_MeterReading'[C electric previous])),
IF(MAX(dim_Column[Report_column_name])-"D_electric_ current" , (SUM('fact_MeterReading'[D corriente eléctrica])),
IF(MAX(dim_Column[Report_column_name])-"E_actual_calculated_units" , (SUM('fact_MeterReading'[Unidades calculadas reales])),
IF(MAX(dim_Column[Report_column_name])-"F_previous_units_used" , (SUM('fact_MeterReading'[F unidades anteriores utilizadas])),
IF(MAX(dim_Column[Report_column_name])-"G_Calculated_Electric_Prct" , (SUM(fact_MeterReading[G Calculated Electric Prct])*100.00),
IF(MAX(dim_Column[Report_column_name])-"I_Total_Electricty" , (SUM('fact_MeterReading'[I Billed Electricity])),
IF(MAX(dim_Column[Report_column_name])-"L_Total_Gas" , (SUM('fact_MeterReading'[O Billed Gas])),
IF(MAX(dim_Column[Report_column_name])-"Ajustes R" , (SUM('fact_MeterReading'[Corrección R])),
IF(MAX(dim_Column[Report_column_name])-"Total_Billing" , SUM('fact_MeterReading'[S Total Facturado]))
))))))))
Gracias de antemano.
Solved! Go to Solution.
a) Tire de MAX(dim_Column[Report_column_name] como una variable al principio de la medida, permitiría que la instrucción if se vea mucho más limpia. Usar el interruptor en lugar de si probablemente sería más limpio todavía
b) ¿Qué intenta mostrar? Puedo ver en su rebanadora que tiene dos cosas seleccionadas, MAX(dim_Column[Report_column_name] sólo va a tener un valor, sin duda?
Hola @CalClack,
Pruébalo así, mucho más fácil de leer
VariableMeasureValue =
IF(hasonevalue(dim_Column[Report_column_name]),
SWITCH(VALUES(dim_Column[Report_column_name]),
"C_electric_previous" , SUM('fact_MeterReading'[C electric previous]),
"D_electric_ current" , SUM('fact_MeterReading'[D electric current]),
"E_actual_calculated_units" , SUM('fact_MeterReading'[E actual calculated units]),
"F_previous_units_used" , SUM('fact_MeterReading'[F previous units used]),
"G_Calculated_Electric_Prct" , SUM(fact_MeterReading[G Calculated Electric Prct])*100.00,
"I_Total_Electricty" , SUM('fact_MeterReading'[I Billed Electricity]),
"L_Total_Gas" , SUM('fact_MeterReading'[O Billed Gas]),
"R adjustments" , SUM('fact_MeterReading'[R correction]),
"Total_Billing" , SUM('fact_MeterReading'[S Total Billed])),
Blank())
Espero que esto ayude,
Richard
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
¿Mis respuestas ayudaron a llegar a una solución? Dale un kudos haciendo clic en Thumbs Up!
Proud to be a Super User!
Sí. Mucho más fácil de leer y de inmediato vi el problema.
El código dice:
VariableMeasureValue ?
IF(hasonevalue(dim_Column[Report_column_name]),
SWITCH(VALUES(dim_Column[Report_column_name]),
"C_electric_previous" , SUM('fact_MeterReading'[C electric previous]),
"D_electric_ current" , SUM('fact_MeterReading'[D corriente eléctrica]),
"E_actual_calculated_units" , SUM('fact_MeterReading'[Unidades calculadas reales]),
"F_previous_units_used" , SUM('fact_MeterReading'[F unidades anteriores utilizadas]),
"G_Calculated_Electric_Prct" , SUM(fact_MeterReading[G Calculated Electric Prct])*100.00,
"I_Total_Electricty" , SUM('fact_MeterReading'[I Billed Electricity]),
"L_Total_Gas" , SUM('fact_MeterReading'[O Billed Gas]),
"Ajustes R" , SUM('fact_MeterReading'[R corrección]),
"Total_Billing" , SUM('fact_MeterReading'[S Total Facturado])),
Blanco())
donde debería estar, y no es culpa tuya porque no tenías idea de dónde estaba recibiendo mis nombres de columna:
VariableMeasureValue á IF(MAX(dim_Column[Report_column_name])-"C_electric_previous" , (SUM('fact_MeterReading'[C electric previous])),
IF(MAX(dim_Column[Report_column_name])-"D_electric_ current" , (SUM('fact_MeterReading'[D corriente eléctrica])),
IF(MAX(dim_Column[Report_column_name])-"E_actual_calculated_units" , (SUM('fact_MeterReading'[Unidades calculadas reales])),
IF(MAX(dim_Column[Report_column_name])-"F_previous_units_used" , (SUM('fact_MeterReading'[F unidades anteriores utilizadas])),
IF(MAX(dim_Column[Report_column_name])-"G_Calculated_Electric_Prct" , (SUM(fact_MeterReading[G Calculated Electric Prct])*100.00),
IF(MAX(dim_Column[Report_column_name])-"I_Total_Electricty" , (SUM('fact_MeterReading'[I Billed Electricity])),
IF(MAX(dim_Column[Report_column_name])-"L_Total_Gas" , (SUM('fact_MeterReading'[O Billed Gas])),
IF(MAX(dim_Column[Report_column_name])"R_correction" , (SUM('fact_MeterReading'[R correction])),
IF(MAX(dim_Column[Report_column_name])-"Total_Billing" , SUM('fact_MeterReading'[S Total Facturado]))
))))))))
Gracias a todos los que aprovecharon esta ayuda de inmediato. Ustedes son los mejores !!!
saludos
Cal Clack en Carmel-by-the-Sea, CA
Sí. Mucho más fácil de leer y de inmediato vi el problema.
El código dice:
VariableMeasureValue ?
IF(hasonevalue(dim_Column[Report_column_name]),
SWITCH(VALUES(dim_Column[Report_column_name]),
"C_electric_previous" , SUM('fact_MeterReading'[C electric previous]),
"D_electric_ current" , SUM('fact_MeterReading'[D corriente eléctrica]),
"E_actual_calculated_units" , SUM('fact_MeterReading'[Unidades calculadas reales]),
"F_previous_units_used" , SUM('fact_MeterReading'[F unidades anteriores utilizadas]),
"G_Calculated_Electric_Prct" , SUM(fact_MeterReading[G Calculated Electric Prct])*100.00,
"I_Total_Electricty" , SUM('fact_MeterReading'[I Billed Electricity]),
"L_Total_Gas" , SUM('fact_MeterReading'[O Billed Gas]),
"Ajustes R" , SUM('fact_MeterReading'[R corrección]),
"Total_Billing" , SUM('fact_MeterReading'[S Total Facturado])),
Blanco())
donde debería estar, y no es culpa tuya porque no tenías idea de dónde estaba recibiendo mis nombres de columna:
VariableMeasureValue á IF(MAX(dim_Column[Report_column_name])-"C_electric_previous" , (SUM('fact_MeterReading'[C electric previous])),
IF(MAX(dim_Column[Report_column_name])-"D_electric_ current" , (SUM('fact_MeterReading'[D corriente eléctrica])),
IF(MAX(dim_Column[Report_column_name])-"E_actual_calculated_units" , (SUM('fact_MeterReading'[Unidades calculadas reales])),
IF(MAX(dim_Column[Report_column_name])-"F_previous_units_used" , (SUM('fact_MeterReading'[F unidades anteriores utilizadas])),
IF(MAX(dim_Column[Report_column_name])-"G_Calculated_Electric_Prct" , (SUM(fact_MeterReading[G Calculated Electric Prct])*100.00),
IF(MAX(dim_Column[Report_column_name])-"I_Total_Electricty" , (SUM('fact_MeterReading'[I Billed Electricity])),
IF(MAX(dim_Column[Report_column_name])-"L_Total_Gas" , (SUM('fact_MeterReading'[O Billed Gas])),
IF(MAX(dim_Column[Report_column_name])"R_correction" , (SUM('fact_MeterReading'[R correction])),
IF(MAX(dim_Column[Report_column_name])-"Total_Billing" , SUM('fact_MeterReading'[S Total Facturado]))
))))))))
Gracias a todos los que aprovecharon esta ayuda de inmediato. Ustedes son los mejores !!!
saludos
Cal Clack en Carmel-by-the-Sea, CA
Todos los Report_column seleccionados, pero "R_correction" es el único que no se está cargando.
Hola @CalClack,
Pruébalo así, mucho más fácil de leer
VariableMeasureValue =
IF(hasonevalue(dim_Column[Report_column_name]),
SWITCH(VALUES(dim_Column[Report_column_name]),
"C_electric_previous" , SUM('fact_MeterReading'[C electric previous]),
"D_electric_ current" , SUM('fact_MeterReading'[D electric current]),
"E_actual_calculated_units" , SUM('fact_MeterReading'[E actual calculated units]),
"F_previous_units_used" , SUM('fact_MeterReading'[F previous units used]),
"G_Calculated_Electric_Prct" , SUM(fact_MeterReading[G Calculated Electric Prct])*100.00,
"I_Total_Electricty" , SUM('fact_MeterReading'[I Billed Electricity]),
"L_Total_Gas" , SUM('fact_MeterReading'[O Billed Gas]),
"R adjustments" , SUM('fact_MeterReading'[R correction]),
"Total_Billing" , SUM('fact_MeterReading'[S Total Billed])),
Blank())
Espero que esto ayude,
Richard
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
¿Mis respuestas ayudaron a llegar a una solución? Dale un kudos haciendo clic en Thumbs Up!
Proud to be a Super User!
a) Tire de MAX(dim_Column[Report_column_name] como una variable al principio de la medida, permitiría que la instrucción if se vea mucho más limpia. Usar el interruptor en lugar de si probablemente sería más limpio todavía
b) ¿Qué intenta mostrar? Puedo ver en su rebanadora que tiene dos cosas seleccionadas, MAX(dim_Column[Report_column_name] sólo va a tener un valor, sin duda?
"Corrección R" no se recupera, pero "Facturación total" es. Gracias de antemano.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |