Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AliPoTD
Helper III
Helper III

Paginated reports - colour code highest value in table

Hello all,

 

Please can I ask for help with Paginated Reports?

 

I have been tasked with creating an invoice which includes the ability to colour code the highest value in a column to be a different colour to make it stand out. This varies per client.

 

I am using a List to loop the data per client, and I have a Table Tablix within this List showing the information as shows:

AliPoTD_0-1727448536911.png

In the column BSC (orig) I need to change the font colour (e.g. to red) of the value 14 as this is the highest value for this column.

Presumably I need to add a formula in the below image, but have no idea what I should write. Can anyone help please?

AliPoTD_1-1727448664025.png

Many thanks.

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @AliPoTD ,

 

Please try:

=IIF(Fields!BSCorig.Value = MAX(Fields!BSCorig.Value, "YourTableName"), "Red", "Black")

I've made a test for your reference:

 

vbofengmsft_0-1727662531649.png

vbofengmsft_1-1727662549222.png

vbofengmsft_2-1727662561566.png

vbofengmsft_3-1727662576737.png

 

Best Regards,

Bof

 

 

Thank you so much for your response.

I have tried your suggestion which at first hasn't worked but I can understand your logic. 

I have entered:

=IIF(Fields!BSC_Original.Value = MAX(Fields!BSC_Original.Value, "BaseData"), "Red", "DarkGray")

but this resulted in all the values in the column being Dark Grey and not red - but I believe this is due to the command stating show red for the highest value in the entire table BaseData, is this correct?

I think I need to tweak the data so that it shows the highest value as red for the Filtered data (using the parameters i have set up)

I have 2 parameters - one is Date and the other is the Farm Number. The resulting data shown in the table in my first post shows the data from Basedata table which has been filtered by Date and Farm Number.

I guess I need to filter the expression to do e.g. 

=IIF(Fields!BSC_Original.Value = MAX(Fields!BSC_Original.Value, "BaseData" (where date = ParameterDate & Farm Number = ParameterFarmNumber), "Red", "DarkGray").

 

Is this correct and if yes, please can you share the syntax? Many thanks in advance.

 

Also, I've only ever used "IF", I've not seen "IIF" before, please can you clarify the difference.

 

Many thanks. I'm learning loads!!

Hi @AliPoTD ,

 

The MAX function calculates within the current context of the report, so as long as the filters in the report are applied, MAX will return the correct results based on those filtering conditions.

 

Best Regarrds,

Bof

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.