condition format for group headers

Hi all,

Is there a way to put a format rules to group headers? For example, I want the text of these headers turn red when the total PAX is more than 12.

 

Screenshot 2022-01-31 195058.png

 

 

Solved Solved
0 5 221
  • UX
1 ACCEPTED SOLUTION

Bravo! 

A quick note.  The portion CONTEXT("Viewtype") = "table" basically means to apply the format rule to all tables.  The one I was suggesting would narrow it down to only THAT specific view.  

Glad you were able to figure it out!

View solution in original post

5 REPLIES 5

Yes.  

In the Format Rule you would need to:

  • Set the condition expression to: SUM(SELECT YourTable[PAX], [GroupingColumn] = [_THISROW].[GroupingColumn])) > 12
  • Set the Column to your Grouping Column
  • Set the TEXT color to Red

If you do not want this Grouping Column to be colored EVERYWHERE in the app, then you would need add to the condition a check for just your Grouping View like this:



AND(
     CONTEXT("View") = "Grouping Table View",
     SUM(SELECT YourTable[PAX], [GroupingColumn] = [_THISROW].[GroupingColumn])) > 12
)

 

Hi Willow,

Thank you very much for your help. However, there are some problems with it.

So for grouping, I group my records by Year > Month > Date > and finally the column named "DESTINATION"

When I use the first condition:

SUM(SELECT(TRANSPORATION RECORD[PAX], [DESTINATION] = [_THISROW].[DESTINATION])) > 12

It also applies to some headers even though they are less than 12

Tony241_1-1643717563886.png

Tony241_2-1643717702311.png

Then 2 tried the 2nd one

AND(
CONTEXT("View") = "Grouping Table View",
SUM(SELECT(TRANSPORATION RECORD[PAX], [DESTINATION] = [_THISROW].[DESTINATION])) > 12)

 

It doesn't work at all:

Tony241_3-1643717961174.png

 

 

What I provided was psuedo-expression syntax because I don't know the specific names of all your columns.

IN the SELECT() expression, you need to make sure the selection criteria produces the SAME list of rows shown in your grouping.  You probably need to add additional criteria parameters to make that happen.  You mentioned your groups are based on year > month > day > DESTINATION, so your SELECT needs to select them this way as well.

 

In the 2nd expression, you will need to replace "Grouping Table View"  with the actual name of YOUR view.  Sorry I wasn't very clear on that.

I have figured it out

AND(
CONTEXT("Viewtype") = "table",
SUM(SELECT(TRANSPORATION RECORD[PAX],
AND ([DATE] = [_THISROW].[DATE],
[DESTINATION] = [_THISROW].[DESTINATION]))) > 12)

 

This work perfectly. Thank you Willow

Bravo! 

A quick note.  The portion CONTEXT("Viewtype") = "table" basically means to apply the format rule to all tables.  The one I was suggesting would narrow it down to only THAT specific view.  

Glad you were able to figure it out!

Top Labels in this Space