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.
Cuando aplico la función FORMAT en la siguiente medida, mi objeto visual de matriz omite el filtro de segmentación de datos y muestra columnas en blanco.
Aquí está el código de medida:
ERMetricValue =
var sel = SELECTEDVALUE(DimERMetricItem[ERMetric])
var val = SWITCH(sel,
"Preventable Percent", FactMeasure[PreventablePct],
"Avoidable Percent", FactMeasure[AvoidablePct],
SUM(FactEmergency[MetricValue]))
var ret =
SWITCH(
sel,
"Preventable Percent", FORMAT(val, "###%"),
"Avoidable Percent", FORMAT(val, "###%"),
"Allowed Amount", FORMAT(val, "$#,##0"),
"Paid Amount", FORMAT(val, "$#,##0"),
"Visits", FORMAT(val, "#,##0"),
"Avoidable", FORMAT(val, "#,##0"),
"Preventable", FORMAT(val, "#,##0")
)
return ret // using FORMAT - formats correctly, ignores filter
// return val not using FORMAT - filters correctly, no formatting
FORMAT no aplicado:
FORMAT aplicado:
Solved! Go to Solution.
Hola @jausubel_e2h ,
Puede utilizar IF() para ocultar valores en blanco.
var ret =
IF (
val <> BLANK (),
SWITCH (
sel,
"Preventable Percent", FORMAT ( val, "###%" ),
"Avoidable Percent", FORMAT ( val, "###%" ),
"Allowed Amount", FORMAT ( val, "$#,##0" ),
"Paid Amount", FORMAT ( val, "$#,##0" ),
"Visits", FORMAT ( val, "#,##0" ),
"Avoidable", FORMAT ( val, "#,##0" ),
"Preventable", FORMAT ( val, "#,##0" )
)
)
Hola @jausubel_e2h ,
Puede utilizar IF() para ocultar valores en blanco.
var ret =
IF (
val <> BLANK (),
SWITCH (
sel,
"Preventable Percent", FORMAT ( val, "###%" ),
"Avoidable Percent", FORMAT ( val, "###%" ),
"Allowed Amount", FORMAT ( val, "$#,##0" ),
"Paid Amount", FORMAT ( val, "$#,##0" ),
"Visits", FORMAT ( val, "#,##0" ),
"Avoidable", FORMAT ( val, "#,##0" ),
"Preventable", FORMAT ( val, "#,##0" )
)
)
¡Gracias! ¡Funcionó como un encanto!
@jausubel_e2h, no puedo notar dónde se perdió el filtro.
El formato hará que esta columna sea texto y se comportará como texto
Hola @jausubel_e2h ,
¿Podrías compartir una muestra conmigo?
Debido a que no tengo los datos, no puedo probar mis pensamientos.
Gracias.
Aiolos Zhao
Proud to be a Super User!
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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |