Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Tengo tabla con 7 columnas
Estoy usando el objeto visual de la tarjeta nueva
Quiero aplicar el color de fondo usando una sola medida
Si SUM(Tabla[1]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[2]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[3]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[4]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[5]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[6]) > 1 , "Verde", "Rojo"
Si SUM(Tabla[7]) > 1 , "Verde", "Rojo"
Sí, CF en segundo plano usando solo una medida como en su solicitud:
CF_Background =
SWITCH(
TRUE(),
SUM(Test[Value]) > 1, "Green",
"Red"
)
Sin embargo, también cambié la estructura en Power Query, quité la dinamización de los datos
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjVR0lEyNQMSBkBsZg5imZlCuUDJ2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"1" = _t, #"2" = _t, #"3" = _t, #"4" = _t, #"5" = _t, #"6" = _t, #"7" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"1", Int64.Type}, {"2", Int64.Type}, {"3", Int64.Type}, {"4", Int64.Type}, {"5", Int64.Type}, {"6", Int64.Type}, {"7", Int64.Type}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value")
in
#"Unpivoted Columns"
para que se vea así:
A continuación, utilicé el objeto visual Matric, eliminé en el panel de opciones los valores de las filas, apliqué el CF en el texto y el fondo
lo más cercano que puedo conseguir es usando una matriz.
Cree una medida de DAX:
CF_Background =
SWITCH(
TRUE(),
SUM('Table'[1]) > 1, "Green",
SUM('Table'[2]) > 1, "Green",
SUM('Table'[3]) > 1, "Green",
SUM('Table'[4]) > 1, "Green",
SUM('Table'[5]) > 1, "Green",
SUM('Table'[6]) > 1, "Green",
SUM('Table'[7]) > 1, "Green",
"Red"
)
Vaya al panel Formato del nuevo objeto visual de tarjeta, vaya a TARJETAS/(serie Todo) / Fondo / fx ==> Valor de campo == CF_Background
Si responde a sus necesidades, marque mi respuesta como la solución. ¡Gracias!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.