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've created a P&L statement in Power BI, by using a model in Excel and used that for a matrix table.
This is the model:
Then I created several measures. The measure that is added to the matrix is this one:
BEDRAGEN =
VAR KEUZE = SELECTEDVALUE('MODEL_RESREK'[Item])
Return
SWITCH(TRUE(),
KEUZE = "OMZET", [OMZET TOTAAL],
KEUZE = "KOSTPRIJS TOTAAL", [INKOOPWAARDE TOTAAL],
KEUZE = "BRUTO-RESULTAAT", [BRUTO-RESULTAAT],
KEUZE = "KOSTEN TOTAAL", [KOSTEN TOTAAL],
KEUZE = "NETTO-RESULTAAT", [NETTO-RESULTAAT],
CALCULATE(Meting[TOT_BEDRAGEN], FILTER(KOPPELING, KOPPELING[Sub-categorie]=keuze)))
The matrix works:
Now for NETTO-RESULTAAT I want to conditionally format, where the background of a positive number is green and a negative number is red.
All I've managed so far is turning the entire row Yellow with this measure and then using it as a conditional formatting on BEDRAGEN:
color = if(max(MODEL_RESREK[Item_lay-out]) ="NETTO-RESULTAAT", "Yellow", "White")
So how do I get to the next step? Any help is very much appreciated.
Solved! Go to Solution.
Try:
color =
IF (
AND ( MAX ( MODEL_RESREK[Item_lay-out] ) = "NETTO-RESULTAAT", [BEDRAGEN] < 0 ),
"Red",
IF (
AND ( MAX ( MODEL_RESREK[Item_lay-out] ) = "NETTO-RESULTAAT", [BEDRAGEN] > 0 ),
"Green",
"White"
)
)
Proud to be a Super User!
Paul on Linkedin.
Try:
color =
IF (
AND ( MAX ( MODEL_RESREK[Item_lay-out] ) = "NETTO-RESULTAAT", [BEDRAGEN] < 0 ),
"Red",
IF (
AND ( MAX ( MODEL_RESREK[Item_lay-out] ) = "NETTO-RESULTAAT", [BEDRAGEN] > 0 ),
"Green",
"White"
)
)
Proud to be a Super User!
Paul on Linkedin.
Have you tried something like this:
color =
SWITCH( TRUE(),
max(MODEL_RESREK[Item_lay-out]) ="NETTO-RESULTAAT", "Yellow",
[BEDRAGEN] > 0, "Green",
[BEDRAGEN] < 0, "Red",
"White"
)
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Hi, this somehow turned all the other rows green and the row NETTO-RESULTAAT is still yellow. 🙂
@JoyceW Can you provide more details?
Here I have it set up like this:
And [PL Amount] is like this:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Thanks for the detailed answer. It's hard for me to explain sometimes, since I'm still a beginner. Paul's solution worked!
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 |