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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors