Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Everyone,
I have a table where all of the rows are Calulation Items. So Job Stars is One Calc.item, Job Starrd YouthHSN in onther Calc. Item, etc. Each Caculated Item is equal to a unique measure.
I want to to color the rows so it's easies to see subgroups in the table (eg brlow)
Does anyone know how to do it?
I think maybe I can set a colout into each measure.
For example this is my measure is
Anyway I can add a colour code to this measure?
Thanks
Solved! Go to Solution.
Hi @AlissaStuart ,
Thank you for reaching out to Microsoft fabric community forum.
Since your rows are generated from a calculation group, the Matrix can't directly apply color to the row headers. However, you can still achieve clear row banding by coloring the values according to the calculation item in each row. To do this, create a simple color measure that checks the selected calc item (using SELECTEDVALUE('Calc Group'[Name])) and returns a hex color with a SWITCH statement, assigning each item or subgroup a specific color. To handle totals, use IF(NOT ISINSCOPE('Calc Group'[Name]), BLANK(), <color>). Then, in the Matrix, use Conditional formatting - Background color - Field value and select this color measure for the Values/Totals. This will shade each data row by calc item, giving you the subgroup highlights you want without changing your calc group setup. If you have many items, consider adding a [Subgroup] column to the calc group table and use it in your SWITCH to keep color assignments organized.
Create calculation groups in Power BI - Power BI | Microsoft Learn
Hope this helps. Please reach out for further assistance.
Thank you.
Hi @legenda689 ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.
Thank you.
Hi @legenda689 ,
The behavior you're experiencing is normal, as calculation items cannot be referenced using [MeasureName]. Instead, in a calculation group, you should compare against the calculation item name text. Please modify your color measure so that the SWITCH function checks the item names as listed in your Calculation Items.
Conditional Format =
SWITCH(
SELECTEDVALUE( 'Calculation group'[Calculation group column] ),
"Job Starts", "#72c197",
"Job Starts YouthHSN", "#FFFF66",
BLANK()
)
Once you've updated the measure, navigate to Conditional Formatting > Background color > Field Value and choose this measure. This will return the correct color hex based on the selected calculation item, allowing the matrix to apply row shading as intended.
This method will ensure that row-level coloring functions properly for calculation groups.
Thank you.
Hi @AlissaStuart ,
Thank you for reaching out to Microsoft fabric community forum.
Since your rows are generated from a calculation group, the Matrix can't directly apply color to the row headers. However, you can still achieve clear row banding by coloring the values according to the calculation item in each row. To do this, create a simple color measure that checks the selected calc item (using SELECTEDVALUE('Calc Group'[Name])) and returns a hex color with a SWITCH statement, assigning each item or subgroup a specific color. To handle totals, use IF(NOT ISINSCOPE('Calc Group'[Name]), BLANK(), <color>). Then, in the Matrix, use Conditional formatting - Background color - Field value and select this color measure for the Values/Totals. This will shade each data row by calc item, giving you the subgroup highlights you want without changing your calc group setup. If you have many items, consider adding a [Subgroup] column to the calc group table and use it in your SWITCH to keep color assignments organized.
Create calculation groups in Power BI - Power BI | Microsoft Learn
Hope this helps. Please reach out for further assistance.
Thank you.
Hi @AlissaStuart ,
I wanted to check if you had the opportunity to review the information provided. If you still require support, please let us know, we are happy to assist you.
Thank you.
Thatnk you for your answer, but I'm still a bit confused about the script.
First, here is what my Calculation Group looks like.
so if I understood correctly my script will begin with something like this (I wrote it only for one vale so far)?
I think my mistake is using [ ] to select job start.
Can you please help again?
Thank you,
Alissa
I whish it was that simple, But because I'm using Caculated Item there is no such option
Hi, did you switch the measures in columns to rows in a Matrix visual? If so, please refer to the settings below.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 1 | |
| 1 | |
| 1 |