Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have a matrix table with several columns. I only want to format a single column (or maybe two).
I have two values, "count (=Anzahl) and "%" - and I only want to format the "%" of a single "country column".
Any idea about that?
Here's a picture that maybe describes better what I want to achieve.
Many thanks in advance! 🙂
Solved! Go to Solution.
hi @cn4422
How do you identify a single country column? What makes one a single country? Or do you mean only Deutschland is to be formatted? If so, create the measures that return the values just for that specific country and apply the conditional formatting to those measures. Example:
Anzahl - Deutschland =
CALCULATE ( [Anzahl], KEEPFILTERS ( 'table'[Country] = "Deutschland" ) )
If you want to apply conditional formatting to a specific country in a matrix, here's how you can do it:
I created a measure to apply the conditional formatting. For example, if I want to format only the data for "Australia," the measure looks like this:
Australia % =IF(AND(ISINSCOPE('Global-Superstore'[Country]),MAX('Global-Superstore'[Country]) ="Australia"),[Discount %],0)
After creating the measure, I applied it as the conditional formatting rule for the Discount column. This ensures that the formatting is only applied to the rows corresponding to "Australia."
I tested this approach with sample data, and it worked perfectly. You can adapt this logic for other countries by simply changing "Australia" to the desired country's name in the measure.
Let me know if you have any questions!
Thanks
Lavdeep Sharma
@Lavdeepsharma Many thanks for your reply - I will also try out your approach! 🙂
Does hist work with format style "gradient" as well for you or just for "rules"?
hi @cn4422
How do you identify a single country column? What makes one a single country? Or do you mean only Deutschland is to be formatted? If so, create the measures that return the values just for that specific country and apply the conditional formatting to those measures. Example:
Anzahl - Deutschland =
CALCULATE ( [Anzahl], KEEPFILTERS ( 'table'[Country] = "Deutschland" ) )
@danextian Thx for your reply!
Exactly, I do have the country column 'lead'[Country] with all the countries in it.
The selection with the measure for country worked!
When I put "Rules" as format style it's fine. However, when I put "gradient" as format style, it's formatting all countries again...
Do you know why this would happen?
The measure returns blank for all other countries. So if you treat as zero then formatting will be applied to those blanks values if using gradient. Use dont format.
@danextian wrote:The measure returns blank for all other countries. So if you treat as zero then formatting will be applied to those blanks values if using gradient. Use dont format.
@danextian ah, that does the trick, thank you very much! 👍
Do you per chance also know if it is possible to format each column based based on itself?
So that the "gradient" does not inlcude the data of the whole matrix as reference, as on this screenshot:
.... but rather each column as its own entity.
You mean to format based on the max value of each column? You can rank row categories within that column. Example.
Rank per Geo =
RANKX ( ALL ( Geo ), [Total Revenue],, DESC, DENSE )
@danextian wrote:You mean to format based on the max value of each column?
Yes, that's exactly what I meant!
So you suggest to include a ranking for each column and then use the ranking as a reference for the formatting?
Yup. Or you can use percentages instead
DIVIDE ( [total revenue], CALCULATE ( [total revenue], ALL ( geo[geo] ) ) )
With rank, you'll get just the number of distinct values to based formatting on. With percentage, the gradient will be based on the min and max percentage value across the whole matrix.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
40 |