user23047540
user23047540

Reputation: 1

Row wise conditional formatting in power bi matrix Visual

Matrix VisualHi I want to create a dax query for a case that if there is a value in a matrix visual and if there is a value greater than or equal to 200 in any cell I want to **highlight whole row ** as red else I want if the value is less that 200 then green in that particular specific cell.

I am expecting a DAX query for conditional formatting.

Upvotes: 0

Views: 596

Answers (1)

Sam Nseir
Sam Nseir

Reputation: 12111

Steps

  1. You will need two new Measures:
Matrix Sales = COALESCE(SUM('Order'[Sales]), "")


Matrix RowCell Formatting =
  var vCell = SUM('Order'[Sales])
  var vRow = CALCULATE(SUM('Order'[Sales]), ALLEXCEPT('Order', 'Order'[Order ID]) )
  RETURN SWITCH(TRUE(), vRow >= 200, "Row", vCell < 200 && NOT(ISBLANK(vCell)), "Cell")
  1. Update your Matrix to use Matrix Sales for the Values.
  2. Set-up Conditional Formatting like so:
      enter image description here


Notes

  • To highlight a row (or every cell in a row), each cell must have a value. Hence why Matrix Sales returns the sum sales or an empty string.
  • It is not possible to add Conditional Formatting to the row headers.

Result
enter image description here

Upvotes: 0

Related Questions