Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Do anyone know how to show the percentage based on the data with specific color box like the photo?
Hi @Hayoung ,
Accoridng to your statement, I suggest you to try conditonal formatting.
For reference: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
Here I create a sample to have a test.
Measure:
Percentage =
VAR _Value =
CALCULATE ( SUM ( 'Table'[Value] ) )
VAR _Total =
CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ) )
RETURN
DIVIDE ( _Value, _Total )
Color =
VAR _RANK = RANKX(ALL('Table'),[Percentage],,DESC,Dense)
RETURN
SWITCH(_RANK,1,"Green",2,"Yellow","Red")
Format your visual > Cell elements > Series [Percentage]>Background
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
May be i need to clarify something. The green color not meaning the largest percentage. The color must be in this order not matter the percenatge is, which mean it could be 1% for the green color and 98% for the red color.
Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
11 | |
3 | |
3 | |
3 | |
2 |