In a table with multi dimensions - Format any alternate row with a different color (only 2 colors)

How do I create a table that looks like that:
image

The number of Teams varies and unknown - I can not set the cell formatting or use the Markdown based on Team name.
The alternate colors are based only on the first dimension.

Help Please :slight_smile:

Hi,
there are two options to achieve this result

  1. manual approach with dimension members
    click on each of teams from Dimension1 in the rows and choose “Cell formatting” item from the dropdown and then set the background for the whole row.

  1. approach with calculated measure
    create a new calcualted measure “Team rank”.
    The measure can be left hidden (not selected in the report).
    It would return the rank for each Team from the Dimension1.

Rank(
  CurrentTuple(VisibleRowsSet()).Item(0),
  Generate(
    VisibleRowsSet(),
    CurrentTuple(VisibleRowsSet()).Item(0)
  )
)

Then use a “Cell formatting” on the column for measure1 with a custom formula:

CASE WHEN 
[Measures].[Team rank]/2
-INT([Measures].[Team rank]/2)>0
THEN "ODD"
ELSE "EVEN"
END

OR

CASE WHEN 
MOD(
  [Measures].[Team rank],2
)>0
THEN "ODD"
ELSE "EVEN"
END

That will let you select one color for “Even” rank numbers and another for “ODD” rank numbers.
And it is enough to create just cell formatting for first measure if you apply the rule for the whole row

Martins / eazyBI

1 Like

Great!
Works Perfectly. I wanted the automated way.

Thanks a lot!

1 Like