Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello, I have two fields, 'user name', and 'category', as Rows in a matrix visualization. The rest of the report is comprised of multiple fields, some text, some numeric, loaded as Values. Users require that 'user name' and 'category' remain visible as users scroll to the right to view the report's values, much as they would in Excel.
Another user requirement is to alternate background color to enhance readibility of rows.
I froze 'user name' and 'category', so that when users scroll to the right, they're able view the values laid out as columns 'user name' and 'category' remain visible.
What I need help with --> get Row 'user name'., which appears as a column of data in the report itself, to alternate background color much as the rest of the report does. 'category' alternates background color as do the Values columns.
When I collapse 'categoryy' into 'user name', then the formatting does apply but that's not an option.
Below: how to get 'user name''s background color to alternate in sync with 'category' and Values columns.
Solved! Go to Solution.
Hey @jrieman
There isn't a direct way in Power BI to achieve alternating background colors for specific rows like "user name" while other rows ("category" and Values) follow a different formatting rule. However, we can achieve a similar effect using a combination of conditional formatting and a calculated column.
Here's how you can accomplish this:
1. Create a Calculated Column:
RowType = VAR CurrentRow = SELECTEDVALUE('Table'[user name]) RETURN IF(ISBLANK(CurrentRow), "Category", "User Name")
This formula checks if the current row is a "user name" by looking for a value in the user name column. If a value exists, it returns "User Name." Otherwise, it returns "Category."
2. Apply Conditional Formatting:
6. Set Up Formatting Rules:
Here, we will set two formatting rules:
Rule 1 (For "Category" and Values):
Rule 2 (For "User Name"):
"User Name" (the value returned by your calculated column when the row is a "user name").This approach should give you the desired result of alternating background colors for "user name" rows while maintaining the formatting for other rows in your matrix.
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
Hey @jrieman
There isn't a direct way in Power BI to achieve alternating background colors for specific rows like "user name" while other rows ("category" and Values) follow a different formatting rule. However, we can achieve a similar effect using a combination of conditional formatting and a calculated column.
Here's how you can accomplish this:
1. Create a Calculated Column:
RowType = VAR CurrentRow = SELECTEDVALUE('Table'[user name]) RETURN IF(ISBLANK(CurrentRow), "Category", "User Name")
This formula checks if the current row is a "user name" by looking for a value in the user name column. If a value exists, it returns "User Name." Otherwise, it returns "Category."
2. Apply Conditional Formatting:
6. Set Up Formatting Rules:
Here, we will set two formatting rules:
Rule 1 (For "Category" and Values):
Rule 2 (For "User Name"):
"User Name" (the value returned by your calculated column when the row is a "user name").This approach should give you the desired result of alternating background colors for "user name" rows while maintaining the formatting for other rows in your matrix.
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |