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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Conditional formatting - Matrix by column instead of the entire dataset

Hello Guys

I created a Matrix visual in Powebi which contains on the header "Months" and the row "Customers". I am just counting the number of items per customer.

I am trying to figure out if there is a way to use conditional formatting to go on the basis of the column, instead of  the entire of the matrix.

Such as when I use the Lowest value to Highest color scale, it will compare the values of the whole table, when I wanna  the conditional formatting to compare lowest to highest of only the values in columns.

Is it possible to do that?

Thanks

6 REPLIES 6
tex628
Community Champion
Community Champion

You need to create another measure to do your conditional formatting on.

if you have a table like this: 

 USASPAINSWEDENDENMARK
Jan10201010
Feb20193191
Mar30203531
Apr50301242


Create a measure that calculates the share of the individual row i relation to the country:

Measure = 
SUM('Table'[Amount]') / CALCULATE(SUM('Table'[Amount]) ; ALL('Calendar'))

 
Then you use that measure as the 'Based on field' on your conditional formatting:

image.png


Connect on LinkedIn
Anonymous
Not applicable

I dont have a table like that


@tex628 wrote:

You need to create another measure to do your conditional formatting on.

if you have a table like this: 

 USASPAINSWEDENDENMARK
Jan10201010
Feb20193191
Mar30203531
Apr50301242


Create a measure that calculates the share of the individual row i relation to the country:

Measure = 
SUM('Table'[Amount]') / CALCULATE(SUM('Table'[Amount]) ; ALL('Calendar'))

 
Then you use that measure as the 'Based on field' on your conditional formatting:

image.png



@tex628 wrote:

You need to create another measure to do your conditional formatting on.

if you have a table like this: 

 USASPAINSWEDENDENMARK
Jan10201010
Feb20193191
Mar30203531
Apr50301242


Create a measure that calculates the share of the individual row i relation to the country:

Measure = 
SUM('Table'[Amount]') / CALCULATE(SUM('Table'[Amount]) ; ALL('Calendar'))

 
Then you use that measure as the 'Based on field' on your conditional formatting:

image.png



In my case 
Month comes from Calendar table and customer comes from customers table 

The values i have a measure called Items received. Even so it possible to achieve your first table based on the my current situation ?

tex628
Community Champion
Community Champion

In that case it should just be the opposite, replace the filter on calendar with customer:

Measure = 
SUM('Table'[Amount]') / CALCULATE(SUM('Table'[Amount]) ; ALL('Customer'))


Let me know if it works! 


Connect on LinkedIn
Anonymous
Not applicable

Give us a graphic representation to get your point...is still quite open your question.... pictures and exel examples of what you have and how would be your expected result.

 

 

Anonymous
Not applicable

Hello 

Thanks for your help

Please see below what i m trying to achieve

 

I have the table below in powerbi and i m using the  the conditional formating  in a Matrix visual which contains on the header "Months" and the row "Customers"

I m using the Lowest value to Highest color scale.

 

What do i need to do?

I would like to put a conditional formatting for each month as per the conditional column. 

Currently, conditional formating in PowerBi works by appling to a range of values in a single column, when you create a Matrix visual using fields such as "MonthYear", all values come from this original single column, thus conditional formatting goes on the entire Matrix.

 

 

pic.png

 

 

 

Hi @Anonymous ,

Actually, the Conditional formatting in Matrix is based on the column rather than whole dataset, in your scenario, for each month, it will sort data differently.

Best Regards,

Teige

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.