The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Solved! Go to Solution.
Hi @fbittencourt,
Thank you for reaching out to the Microsoft Fabric Forum Community.
I’ve reproduced your scenario in Power BI Desktop using your icon + color formatting logic, and I was able to achieve the expected output combining both the KPI value and the icon with conditional color formatting in a single card.
For your reference:
I’ve attached a .pbix file to help you review.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi @fbittencourt,
Thank you for reaching out to the Microsoft Fabric Forum Community.
I’ve reproduced your scenario in Power BI Desktop using your icon + color formatting logic, and I was able to achieve the expected output combining both the KPI value and the icon with conditional color formatting in a single card.
For your reference:
I’ve attached a .pbix file to help you review.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Create a measure for the icon:
DAX
PCTKPI Icon =
VAR KP = [PctKPI 2]
VAR Icon =
SWITCH(
TRUE(),
ABS(KP) >= 0 && ABS(KP) <= 0.0549, "🟢",
ABS(KP) >= 0.055 && ABS(KP) <= 0.1049, "🟡",
ABS(KP) >= 0.105 && ABS(KP) <= 1, "🔴",
""
)
RETURN
Icon
Create a measure for the value:
DAX
PCTKPI Value =
VAR KP = [PctKPI 2]
RETURN
FORMAT(KP, "0.00%")
Combine the icon and value in a new measure:
DAX
PCTKPI Icon + Value =
[PCTKPI Icon] & " " & [PCTKPI Value]
Go to the card visual where you want to display the combined measure.
Select the measure PCTKPI Icon + Value.
In the visualizations pane, go to the "Format" section.
Find the "Data label" or "Values" section (depending on the visual type).
Click on "Conditional formatting" and choose "Font color".
Set up rules based on the value of [PctKPI 2] to apply the desired colors.
Proud to be a Super User! |
|
User | Count |
---|---|
81 | |
74 | |
42 | |
30 | |
28 |
User | Count |
---|---|
108 | |
96 | |
53 | |
48 | |
47 |