Forum Discussion

helen_p's avatar
helen_p
Frequent Visitor
3 years ago

Conditional format rows in a matrix table based on a measure

Dear Power BI community

 

What I would like to achieve is

 

I want to create a matrix table where the headings of rows (which will be in a hierachy) are conditionally formatted based on the outcome of  a measure.    If the lowest row in the hierachy does not meet the condition of the measure, when the matrix table is NOT expanded, then the highest level in the table shows the same colour too

 

What is the data like

There are 3 columns which are in a hierachy Hospital >> Care Group >> Ward

 

I.e. 

 

Hospital   Care Goup   Ward

SGH              A                 1    

SGH              A                 2

SGH              B                 3

 

Measures

 

I have 2 measures called "Actual discharges" and "Expected Discharges" and when put together with the columns, it looks like this

 

 

Hospital   Care Goup   Ward    Actual discharges       Expected discharges

SGH              A                 1                3                                        2

SGH              A                 2                4                                        5

SGH              A                 3                3                                        2

SGH              B                 4                7                                        6

 

What to base the conditional format on

 

I wwas thinking of creating another measure where 

if([Actual Discharges] <= [Expected Discharges], "Red", "Green")
 
Expected outcome
 
In a NON expanded matrix table  Care group A would be red because Ward 2 still has an issue and is not meeting the expected number of discharges
 
Is this at all possible?
 
 

 

 

 

 

 

 

 

 

1 Reply