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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TdlmRS
Frequent Visitor

Color de Fondo para celdas vacías en una Matriz

Hola a Todos,

Por favor su ayuda para poder colocar  color de fondo en los espacios vacíos de una matriz, el color debe obedecer a la condición dada según la línea. Actualmente he logrado realizar el color de fondo para las celdas que si tiene valores con la siguiente medida:

Color =
Var _ind = SELECTEDVALUE(Tabla[Estado])
return
SWITCH(TRUE(),
_ind= "CONCLUIDA","#ADDFCD",
_ind= "ACTIVA", "#FAE9A0",
_ind= "CANCELADA", "#F1BDBC"
)

 

TdlmRS_1-1686283042696.pngTdlmRS_0-1686283856940.png

 

 - Lo ideal que se requiere es como la siguiente imagen:

 

TdlmRS_2-1686283593774.png

 

 Muchas gracias por su apoyo.

2 ACCEPTED SOLUTIONS
v-yueyunzh-msft
Community Support
Community Support

Hi , @TdlmRS 

According to your description, you want to show colors for the whole row.

For your need , here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1686539457470.png

 

(2)Not all colors are displayed, the main reason is that the data is real, we need to create a calculated table to complete the data.

Table 2 = ADDCOLUMNS( CROSSJOIN( ALL('Table'[Nombres],'Table'[Sub]) , VALUES('Table'[Column])) ,  "Value" , CALCULATE( SUM('Table'[Value]) , TREATAS({[Column]},'Table'[Column]),TREATAS({[Sub]},'Table'[Sub]),TREATAS({[Nombres]} ,'Table'[Nombres])), "Estado", CALCULATE( MAX('Table'[Estado]) , TREATAS({[Column]},'Table'[Column]),TREATAS({[Sub]},'Table'[Sub]),TREATAS({[Nombres]} ,'Table'[Nombres]))
)

Then wen can get the table like this:

vyueyunzhmsft_1-1686539653340.png

 

(3)We also can create a measure like this:

Measure = IF( SUM('Table 2'[Value])<> BLANK() ,SUM('Table 2'[Value]) ,UNICHAR(10))

Then we can put the measure on the visual and we can also configure the color as background and we can get your need:

vyueyunzhmsft_2-1686539750236.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Hi , @TdlmRS 

Of course , you can do it, you just need to select this in configuration:

vyueyunzhmsft_0-1686708196801.png

The result is as follows:

vyueyunzhmsft_1-1686708213056.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @TdlmRS 

According to your description, you want to show colors for the whole row.

For your need , here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1686539457470.png

 

(2)Not all colors are displayed, the main reason is that the data is real, we need to create a calculated table to complete the data.

Table 2 = ADDCOLUMNS( CROSSJOIN( ALL('Table'[Nombres],'Table'[Sub]) , VALUES('Table'[Column])) ,  "Value" , CALCULATE( SUM('Table'[Value]) , TREATAS({[Column]},'Table'[Column]),TREATAS({[Sub]},'Table'[Sub]),TREATAS({[Nombres]} ,'Table'[Nombres])), "Estado", CALCULATE( MAX('Table'[Estado]) , TREATAS({[Column]},'Table'[Column]),TREATAS({[Sub]},'Table'[Sub]),TREATAS({[Nombres]} ,'Table'[Nombres]))
)

Then wen can get the table like this:

vyueyunzhmsft_1-1686539653340.png

 

(3)We also can create a measure like this:

Measure = IF( SUM('Table 2'[Value])<> BLANK() ,SUM('Table 2'[Value]) ,UNICHAR(10))

Then we can put the measure on the visual and we can also configure the color as background and we can get your need:

vyueyunzhmsft_2-1686539750236.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Excelente!. Pude lograr lo requerido.

Solamente no puedo colocar los totales en color blanco, pero es secudario.

Muchas gracias.

 

TdlmRS_1-1686694780047.png

 

Hi , @TdlmRS 

Of course , you can do it, you just need to select this in configuration:

vyueyunzhmsft_0-1686708196801.png

The result is as follows:

vyueyunzhmsft_1-1686708213056.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.