Forum Discussion
Conditional formatting matrix table where column/row values are different
- 6 years ago
djanszentql it is really great question and here is the solution, I broken down the measures in small pieces to easily understand the solution, ofcourse all this can be done in one measure as well, there are 5 measure and final KPI Color measure return the color which will be used to highlight the row
Sum of Amount = SUM ( Amount[Amount] ) Sum of Servers = CALCULATE ( [Sum of Amount], ALLSELECTED( Amount[Server] ) ) # of servers = COUNTROWS ( CALCULATETABLE( VALUES ( Amount[Server] ), ALL ( Amount ) ) ) Avg by Server = DIVIDE ( [Sum of Servers], [# of servers] ) KPI Color = IF ( [Sum of Amount] <> [Avg by Server], "Red" )On value section, choose drop down menu next to Amount to do the conditioal formatting to use KPI Color measure
djanszentql perfect what you did to replace Amount wiht your own field, and you don't need to create seperate measure, it will work for each row in your model. Solution is global to your dataset until you see it is not working
djanszentql sorry I got it what you mean, let me send your single measure for all this. sorry for the confusion.
- djanszentql6 years agoHelper I
No need to apologize. I appreciate the help. You can just call the table 'Query1' by the way. I have not renamed it.
- parry2k6 years agoSuper User
djanszentql here you go, single measure except # of Server count is kept seperate since that will be used in all the measures
KPI Color Single Measure = VAR __sumofAmount = SUM ( Amount[Amount] ) VAR __sumofServers = CALCULATE ( SUM( Amount[Amount] ), ALLSELECTED( Amount[Server] ) ) VAR __avgbyServer = DIVIDE ( __sumofServers, [# of servers] ) RETURN IF ( __sumofAmount <> __avgbyServer, "Red" )- djanszentql6 years agoHelper I
Sorry, but I am still confused what Amount[Amount] is suppose to be? As in, what column are you referring to when you specify [Amount]?
- parry2k6 years agoSuper User
djanszentql amount would be config_value, run_value, maximum and minimum, so you will have four measure for each column and replace amount with these columns in your measure.
- djanszentql6 years agoHelper I
ahh okay perfect. Thank you so much!