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.
Good morning,
In a table, I use concatenation to group 3 values in the same cell.
I would like to be able to change the color of just one of the 3 values based on it.
How to do ?
Thanks in advance.
Mathieu
DAX:
Solved! Go to Solution.
Use Tabulator PowerBI Visual
You can use this table in your report and just create a HTML measure like i have sent above. This is working fine,
can you please share your measure code here
Here is what I did to test :
Assuming you want to change the color of the value from [DeltaSat (Agent)] based on a condition, you can use the following DAX code:
DeltaSat (Formatage) =
VAR AgentColor = IF([DeltaSat (Agent)] < 0.2, "Red", "Black") -- Define your condition here
VAR AgentText = FORMAT([DeltaSat (Agent)], "Percent")
VAR EquipeText = FORMAT([DeltaSat (Equipe)], "Percent")
VAR CompétenceText = FORMAT([DeltaSat (Compétence)], "Percent")
RETURN
SWITCH(
TRUE(),
[DeltaSat (Agent)] < 0.2, "<span style='color:" & AgentColor & "'>" & AgentText & "</span> | " & EquipeText & " | " & CompétenceText,
TRUE(), AgentText & " | " & EquipeText & " | " & CompétenceText
)
In this code, we first define a variable AgentColor that checks a condition for [DeltaSat (Agent)] and sets the color to "Red" if the condition is met, otherwise "Black". You can change the condition as per your requirement.
Then, we use the SWITCH function to conditionally format the text in the DeltaSat (Formatage) column. If the condition is met, it wraps the [DeltaSat (Agent)] value in an HTML span element with the specified color.
Make sure you replace the condition in IF with your specific criteria for changing the color, and adjust the color and formatting as needed. This code assumes that you are working with a table that can interpret HTML styling for text color.
Hello @_elbpower
Thanks for your return.
Are you sure the HTML code works in DAX, I tested it, but without success?
Mathieu
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 |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |