cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper IV

## Formatiting matrix

Hello,

I have table of data as below :

 Center Machine install checked Filter AccountLock AccountUnlock passwordcontrol passwordReuse authorized Service Log timeout apttsv1 sxmus1 OK OK OK OK OK KO OK OK OK OK OK apttsv1 sxmus2 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus3 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus4 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus5 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus6 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus7 OK OK OK OK OK KO OK OK OK KO OK apttsv1 sxmus8 OK OK OK OK OK KO OK OK OK KO OK apttsv2 sxmus9 OK OK OK OK OK KO OK OK OK KO OK apttsv2 sxmus10 OK OK OK OK OK KO OK OK OK KO OK apttsv2 sxmus11 OK OK OK OK OK KO OK OK OK KO OK

I would like to formatting the matrix below :

I am trying to format the cell:

- OK : Green

- KO : Red

- Machine  : Green if all OK

- Machine : Red if there is a KO

-Center : Green if all Machine Green (All OK)

- Center: Red if any Machine Red (If any KO)

Tg

1 ACCEPTED SOLUTION
Resolver IV

Further to this @vnqt

I do have a potential work-around.

First, structure the data by unpivoting it in Power Pivot and adding a column that is "1" for KO and "0" for OK:

This will then make it much easier to create a Matrix using those values!

Then, create a measure that summarises "hasKO" by making a sum of the values. We now know that if the sum = 0 there are no KO's and anything else means that there is at least one.

`anyKO = sum(Sheet1[hasKO]) `

Use this measure in the conditional formatting to colour values with 0 as green and anything else as red:

This will also colour the value totals. Using the value totals as a comparison will give you an indication of the machine and server situations:

HTH

Pi

3 REPLIES 3
Resolver IV

Further to this @vnqt

I do have a potential work-around.

First, structure the data by unpivoting it in Power Pivot and adding a column that is "1" for KO and "0" for OK:

This will then make it much easier to create a Matrix using those values!

Then, create a measure that summarises "hasKO" by making a sum of the values. We now know that if the sum = 0 there are no KO's and anything else means that there is at least one.

`anyKO = sum(Sheet1[hasKO]) `

Use this measure in the conditional formatting to colour values with 0 as green and anything else as red:

This will also colour the value totals. Using the value totals as a comparison will give you an indication of the machine and server situations:

HTH

Pi

Helper IV

Resolver IV

Hi Tg!

Formatting Cell values is simple, you can format them conditionally using a column value. Here I have created a column that corresponds to "Log" and returns a colour:

First Log Color = If(Sheet1[Log]="KO","Red","Green")
Apply this to the formatting of the Log column by clicking the drop down next to the value name, and navigating to "background color" under "conditional formatting".
In the resulting dialogue, choose Field Value as the format Style and select the new [First Log Color] field that has been created:

When applied, this will now color your "Log" field appropriately

To apply this to the whole visual you will need to create one for each column in the Matrix

For the Centre and Machine values, I haven't been able to find a way to colour these conditionally, yet. There is currently an idea being upvoted if you would like to partake:

Regards,

Pi

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors