The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
When creating a Matrix visual , I would like to know the percentage of recharge per resource. In my Data these values are hours (whole numbers). In the Matrix I turn these hours into percent of row total to have percentage values per resource. After doing that I can't conditional format on these percentages. (see screenshot). I would like to have red color when Yes value is below 86% and green if 86% or above. Someone here who has a bypass for that via some code?
Someone already have added this as idea to solve in next updates if voted enough
Solved! Go to Solution.
Hi @mdebekke
Why don't you try creating measures as I have mentioned below for Yes % and No %.
1. Create measures
Yes % = CALCULATE(SUM(Table[YesHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))
No % = CALCULATE(SUM(Table[NoHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))
2. Convert datatype of these measures to % using the modelling tab
3. Use the measures in the matrix as in the above screenshot
4. You can use conditional formatting property available for matrix and set the color for any column as per the range conditions
This should serve your purpose!
Do try this approach and accept as solution if it works..and let me know in case of any queries!
Thanks,
Suguna.
Hi @mdebekke
Why don't you try creating measures as I have mentioned below for Yes % and No %.
1. Create measures
Yes % = CALCULATE(SUM(Table[YesHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))
No % = CALCULATE(SUM(Table[NoHours])/(SUM(Table[YesHours]) + SUM(Table[NoHours])))
2. Convert datatype of these measures to % using the modelling tab
3. Use the measures in the matrix as in the above screenshot
4. You can use conditional formatting property available for matrix and set the color for any column as per the range conditions
This should serve your purpose!
Do try this approach and accept as solution if it works..and let me know in case of any queries!
Thanks,
Suguna.
To solve this to get the measures into my file I created 2 custom columns via "edit queries" with below formula, because I had 1 hours column:
= if Text.Contains([RECHARGE], "YES") then [Hours] else 0)
= if Text.Contains([RECHARGE], "NO") then [Hours] else 0)
This solved combined with your solution my challenge 🙂
Thanks!!!