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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
kabra_ashish
Helper III
Helper III

Table Visual - Conditional Formatting

I have a table visual with the below fields:

 

Date             Trans_Id        Spend($)

Jan 1              ABC123            100

Jan 2              DEF123            100

Jan 3              GHI123            100

Jan 3              JKL123            100

Jan 4              XYZ123            100

 

Is there a way to highlight those records which appear the maximum times? So in this case Jan 2 appears twice and I would like to highlight both the Jan 2 records. I do not want the others to be highlighted as they appear only once.

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @kabra_ashish ,

 

Create a measure

Measure = 
var _maximumcountall = MAXX(SUMMARIZE(ALL('Table'),'Table'[Date],"CC1",COUNT('Table'[Date])),[CC1])
var _maxdate = MAX('Table'[Date])
var _count = COUNTROWS(FILTER(ALL('Table'), 'Table'[Date] = _maxdate))
RETURN
if (_count = _maximumcountall, 1, 0)

 

2.JPG2.JPG3.JPG

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

6 REPLIES 6
v-diye-msft
Community Support
Community Support

Hi @kabra_ashish 

 

If the above posts help, please kindly mark it as a answer to help others find it more quickly. thanks!

If not, please kindly elaborate more.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
harshnathani
Community Champion
Community Champion

Hi @kabra_ashish ,

 

Create a measure

Measure = 
var _maximumcountall = MAXX(SUMMARIZE(ALL('Table'),'Table'[Date],"CC1",COUNT('Table'[Date])),[CC1])
var _maxdate = MAX('Table'[Date])
var _count = COUNTROWS(FILTER(ALL('Table'), 'Table'[Date] = _maxdate))
RETURN
if (_count = _maximumcountall, 1, 0)

 

2.JPG2.JPG3.JPG

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

amitchandak
Super User
Super User

@kabra_ashish , Create a measure like

if( rankx(all(Date), calculate(count(Table[col1])),,desc,dense) =1 , "red", "green")

or
if( rankx(all(Date), calculate(count(Table[col1])allexcept(Table, table[Date])),,desc,dense) =1 , "red", "green")

 

and use that in conditional formatting with "field" option

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@kabra_ashis - You could create a measure like:

 

 

Measure = 
  VAR __Date = MAX('Table'[Date])
  VAR __Table = FILTER(ALL('Table'),[Date]=__Date)
RETURN
  COUNTROWS(__Table)

You can then base your conditional formatting off of this measure.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler After creating this measure and then incorporating to the table visual it still gives 1 for each record

@kabra_ashish - We are doing something different then. See attached PBIX file. You want Page 7, Table 7

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.