Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AlissaStuart
Regular Visitor

Edit Table with Calculation Items

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)

AlissaStuart_1-1761674678811.png

 

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

Job Starts =
CALCULATE(
    DISTINCTCOUNT('XX'[Plan Item ID]),
    FILTER('XX',
    'XX'[Working] = "yes")
)

Anyway I can add a colour code to this measure?
Thanks 

1 ACCEPTED SOLUTION
v-tsaipranay
Community Support
Community Support

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.

View solution in original post

7 REPLIES 7
v-tsaipranay
Community Support
Community Support

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.

v-tsaipranay
Community Support
Community Support

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.

v-tsaipranay
Community Support
Community Support

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. 

legenda689_2-1762117711148.png

 


so  if I understood correctly my script will begin with something like this (I wrote it only for one vale so far)? 

Conditional Format =
SWITCH(
    SELECTEDVALUE('Calculation group'[Calculation group column]),
    [Job Starts],"#72c197","#72c177"
)
But when I apply to the table via following method nothing happens to the table. 
legenda689_1-1762117657955.png

 

I think my mistake is using [ ] to select job start. 

Can you please help again? 
Thank you, 
Alissa 

AlissaStuart
Regular Visitor

I whish it was that simple, But because I'm using Caculated Item there is no such option

DaleT
Resolver II
Resolver II

Hi, did you switch the measures in columns to rows in a Matrix visual? If so, please refer to the settings below.

DaleT_0-1761690830624.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.