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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Richard_Halsall
Helper III
Helper III

Matrix: Conditional formatting values using measure

Hi

I am struggling to conditionally format a matrix field with a measure.

 

Data table

 

Richard_Halsall_0-1675347775785.png

 

The measure I have written

 

Measure =
var projectend = MAX('FactDemandAllocationWith Certs'[ProjectEndDate])
var certificatend =MAX('FactDemandAllocationWith Certs'[End_Date__c])
var certificatedate = FORMAT(MAX('FactDemandAllocationWith Certs'[HasCertDate] ), "Standard")

var result =
SWITCH(
    TRUE(),
    certificatedate = "0"  , "red",
    projectend > certificatend, "blue",
    "green"
)
RETURN result
 
Matrix with measure in values section
 Richard_Halsall_0-1675347018395.png
Matrix with measure removed from values section
Richard_Halsall_1-1675347069503.png

 

I would like the matrix to be coloured as the first example but without having to use the measure in the values

 

Any help would be appreciated. Thanks

 
1 REPLY 1
lbendlin
Super User
Super User

To report on things that aren't there you need to use disconnected tables and/or crossjoins.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.