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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jcastr02
Post Prodigy
Post Prodigy

Conditional Formatting based on Max number in row - Matrix

I am trying to change the background color of the cell in each ROW of the highest number.  Example, In the second row, the 30% would change color to dark grey in background.  This is a matrix visual . Is there a DAX for this?

 

Matrix - Color Needed.png

1 ACCEPTED SOLUTION

HI @jcastr02 

I opened your file and it was my laptop that was very jammed and crashed,  your report is so big.please try this formula:

% of Attribute = divide(calculate(COUNTA('30 Day - Attribute'[Response])),CALCULATE(COUNTA('30 Day - Attribute'[Response]),FILTER(ALLSELECTED('30 Day - Attribute'),'30 Day - Attribute'[Attribute.1]=MAX('30 Day - Attribute'[Attribute.1]))))

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
amitchandak
Super User
Super User

I assume Strongly Agree, Agree etc are part of on dim.

Create a measure to have max value at attribute level and use this measure to calculate color.

 

In the conditional formatting; for each column, go to advance control and choose field and this color measure.

 

 

 

@amitchandak would you be able to recommend a DAX, I am struggling there.  Color Background.png

hi @jcastr02 

You could create a measure as below:

Ismax = IF( MAXX(ALLSELECTED('Table'[Response]),[Measure])=[Measure],1,0)

Note: [Measure] is the measure in your current matrix

Then do the conditional formatting as below:

4.JPG

Result:

5.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lili6-msft    I don't have a measure in my current matrix - I am just taking a count of the responses and showing as % of total from row.  Will that be a problem?

Hello @v-lili6-msft   seems the measure is not working, I've added screen shots for your guidance

 

linh.png

hi @jcastr02 

[Attribute.1] is a Text value, you couldn't use SUM for it, you need use COUNT instead.

And if you still have the problem, please share a simple sample pbix file for us have a test. that will be a great help for this simple case.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

https://1drv.ms/u/s!Ava_12t7CNJtkCGALXOtGpymk1pF 

 

@v-lili6-msft   see the 30 day Feedback Tab, table is on bottom

HI @jcastr02 

I opened your file and it was my laptop that was very jammed and crashed,  your report is so big.please try this formula:

% of Attribute = divide(calculate(COUNTA('30 Day - Attribute'[Response])),CALCULATE(COUNTA('30 Day - Attribute'[Response]),FILTER(ALLSELECTED('30 Day - Attribute'),'30 Day - Attribute'[Attribute.1]=MAX('30 Day - Attribute'[Attribute.1]))))

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @jcastr02 

You could just create a measure as below

This measure is the logic of 'showing as % of total from row':

Measure = DIVIDE(CALCULATE(SUM('Table'[Value])),CALCULATE(SUM('Table'[Value]),ALLSELECTED('Table'[Response])))
 
Regards,
Lin
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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