Skip to main content
Solved

Conditionnal Formatting based on the hierarchy level

  • October 16, 2025
  • 5 replies
  • 107 views

Sandy B
Apprentice Author
Forum|alt.badge.img

Hello community,

 

I have a dimension City, with Department/Region/Country parents.

 

I would like to use a Conditional Formatting on a metric, probably based on another source metric, to display raw data dynamically on a specific color according to the level of granularity.

 

But I don’t know how to create a metric which calculate the level of granularity of my dimensions. 

 

Let’s see my exemple: 

Dimension 1 : City 

Dimension 2 : Department > City

Dimension 3 : Region > Department

Dimension 4 : Country > Region

Metric : Budget per city

 

Do you have any clue?

 

Screenshot with fixed colors*

 

Best answer by Laszlo

Hi ​@Sandy B 

 

This won’t need conditional formatting.

Your metric appears to be pivoted by all four dimensions, which is great.

You can apply formatting to the different levels in Tabular layout. Start by formatting your top level and  selecting Apply to: Every instance of my selection. Then move to the next level down and format it. Continue this for each level downways until you’re done. Once finished, switch back to Tree view in the Layout menu.

 

 

5 replies

Chahat
Master Helper
Forum|alt.badge.img+14
  • Master Helper
  • 79 replies
  • October 16, 2025

The metric to which you want to apply the conditional formatting has just the “City” dimension ?

or does it have all the dimensions: “City, Dept, Region, Country” ?


Sandy B
Apprentice Author
Forum|alt.badge.img
  • Author
  • Apprentice Author
  • 2 replies
  • October 17, 2025

Hello Chahat,

On this metric I only have 2 dimensions: Month and City.

My dimension City has Dept, Region and Country have properties (with a Data type on their dimension).

 


Laszlo
Helper
Forum|alt.badge.img+6
  • Helper
  • 23 replies
  • Answer
  • October 17, 2025

Hi ​@Sandy B 

 

This won’t need conditional formatting.

Your metric appears to be pivoted by all four dimensions, which is great.

You can apply formatting to the different levels in Tabular layout. Start by formatting your top level and  selecting Apply to: Every instance of my selection. Then move to the next level down and format it. Continue this for each level downways until you’re done. Once finished, switch back to Tree view in the Layout menu.

 

 


Sandy B
Apprentice Author
Forum|alt.badge.img
  • Author
  • Apprentice Author
  • 2 replies
  • October 24, 2025

Hi,

 

Thank you ​@Laszlo it should work.

I am just wondering if the formatting will be automatically apply if I create new item (city and/or department, region) ?

 

Have a great day.


Laszlo
Helper
Forum|alt.badge.img+6
  • Helper
  • 23 replies
  • October 24, 2025

No worries ​@Sandy B 

If your “Apply to” is set to Every instance of my selection then the formatting will apply to new items too.

Cheers