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

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.

Reply
Anonymous
Not applicable

FORMAT ignora el filtro

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:

c1.JPGSin FORMAT

FORMAT aplicado:

c2.JPGCon FORMAT

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

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" )
    )
)

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

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" )
    )
)

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

¡Gracias! ¡Funcionó como un encanto!

amitchandak
Super User
Super User

@jausubel_e2h, no puedo notar dónde se perdió el filtro.

El formato hará que esta columna sea texto y se comportará como texto

AiolosZhao
Memorable Member
Memorable Member

Hola @jausubel_e2h ,

¿Podrías compartir una muestra conmigo?

Debido a que no tengo los datos, no puedo probar mis pensamientos.

Gracias.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.