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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
nick9one1
Helper III
Helper III

formatting cell if greater than related value

I have two tables, the left is a simple table of thresholds for each block. 

The right table is a count of instances for each block 

nick9one1_0-1727999058757.png


I would like to create a formatting rule that shades the cells based on the relationship. 

e.g. Conifers for November is 2, which is above the 1 in 20 threshold but below 1 in 50. 

I was hoping to write a measure like this, but it seems you can only use 'related' in row context. 

 

GreaterThanThreshold = IF([AlarmCount]>RELATED(['Threshold Data'1 in 20'],"1 in 20")

 

 

 

3 REPLIES 3
nick9one1
Helper III
Helper III

Thank you for the replies. Both look like they require me to group the 'issues' table differntly. 

at the moment it is in this format. 

nick9one1_0-1728033071800.png

 

I've made a start by using the summerize command;

Counts = 

SUMMARIZE('issues (2)'
      , ROLLUP( 'issues (2)'[Block]),'issues (2)'[IncidentDateFull]  
      , "Alarms", COUNT('issues (2)'[id])  
      
)


Which gives me this;

nick9one1_1-1728033194885.png

 

I need to figure out how to add an additional filter, as ther are a number of false alarms I'm not interested in. but My initial issue is that this new summary table and my original table dont quite match.

Below the new Summerize is on the left, and the original table on the right. There are a few blocks that have slightly different figures. 

nick9one1_3-1728033607417.png

 

 

 

 



Anonymous
Not applicable

Hi @nick9one1 ,hello PhilipTreacy, thank you for your prompt reply!

 
You could also use LOOKUPVALUE function to meet your requirements:

Threshold_20 = LOOKUPVALUE('Threshold Data'[1 in 20 threshold], 'Threshold Data'[Building Name], SELECTEDVALUE('EventCount'[Block]))

 

The same applies to threshold 50:

Threshold_50 = LOOKUPVALUE('Threshold Data'[1 in 50 threshold], 'Threshold Data'[Building Name], SELECTEDVALUE('EventCount'[Block]))

Create different format measures for different months(can be changed as needed):

Format_September = 
IF(
    SELECTEDVALUE('EventCount'[September]) > 'EventCount'[Threshold_20],
    "pink", 
    ""
)

vyajiewanmsft_2-1728029827356.png

 Then apply conditional formatting to all month columns using different format measures as shown below:

vyajiewanmsft_1-1728029777045.png

vyajiewanmsft_3-1728029867461.png

Result for your reference:

vyajiewanmsft_4-1728029922824.png

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

PhilipTreacy
Super User
Super User

Hi @nick9one1 

 

Download PBIX file with the example below

 

The 1 in 20 threshold for Nov for Conifers is 4.35 so 2 is not above that?

 

You should really have your 'Count' data laid out in a tabular format like this

 

PhilipTreacy_0-1728002815166.png

 

Power BI and Excel work best wth data laid out like this, if it isn't you run into issues trying to do analysis and reporting.

 

If you lay the data out like that, you can then use a Matrix visual to show you the same info

 

PhilipTreacy_1-1728002928941.png

But you can now achieve what you want by writing this measure

 

 

Exceeds 1 in 20 = 

VAR _Threshold = CALCULATE(MAX('Thresholds'[1 in 20 Threshold]), 'Thresholds'[Building Name] = SELECTEDVALUE(Counts[Block]))

RETURN 

IF( SELECTEDVALUE(Counts[Count]) > _Threshold, "orange")

 

 

 

and using that as the rule for the Conditional Formatting on the matrix cells

 

PhilipTreacy_2-1728003048602.png

 

giving this

 

PhilipTreacy_3-1728003069249.png

 

Note that I've adjusted the 1 in 20 Threshold value to be 1 to make this work.  Otherwise there'd be no colour in the cell as 2 is less than 4.35

 

PhilipTreacy_4-1728003171815.png

 

Doing it this way you only need 1 CF rule.  With your original data laid out with a column for each month/date, you need a rule for each column.

 

Regards

 

Phil

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors