Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I want to apply conditional formatting ('Field Value', based on a measure) to only the top level of a matrix, regardless of its state (collapsed/expanded).
It works well when "Totals Only" is selected and the matrix is expanded
but the formatting disappears upon collapsing to the top level:
Here is the measure:
Solved! Go to Solution.
the idea is that the DAX code you wrote ( the isinscope part ) will always be true on all levels,
because project group is the first level , so all lower levels are inscope of the first level.
modify you code to this :
switch (
true() ,
isinscope( level 2 col of the matrix ) , blank() ,
ISINSCOPE('Sample Table'[Project Group]),
if ( SUM('Sample Table'[Revenue]) > 1000000, "Green", "Red")
)
NB :
you can use if statement .
i prefer switch for readability .
when applying the conditional formatting,
apply it to total and values
hope this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🙏
Hi Daniel,
Thanks for your response. When I select Values and Totals, it works well when the matrix is collapsed:
But, it also applies to level 2, which I don't want:
the idea is that the DAX code you wrote ( the isinscope part ) will always be true on all levels,
because project group is the first level , so all lower levels are inscope of the first level.
modify you code to this :
switch (
true() ,
isinscope( level 2 col of the matrix ) , blank() ,
ISINSCOPE('Sample Table'[Project Group]),
if ( SUM('Sample Table'[Revenue]) > 1000000, "Green", "Red")
)
NB :
you can use if statement .
i prefer switch for readability .
It works! Thank you so much!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
51 | |
39 | |
26 |
User | Count |
---|---|
84 | |
57 | |
45 | |
44 | |
36 |