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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
SloeMo
Frequent Visitor

Conditional formatting Text count based as a % on the column total

Hi,

 

Apologies for posting this but I am having issues with conditional formatting text, I have tried reading variuous threads but cannot get my head into gear.

 

I have a text column called KRI Category, this contains values FP, IM, PS, Support. Within a matrix I can show a count of the values which are correct. I can add the same field to show the value as a % of the grand total. this also shows the correct %.

 

But how can I set conditional formatting to show metrics based upon the values in the matrix? I have tried rules based on number as decimal and numbers as a % and it is not correct.

 

SloeMo_0-1662733688737.png

Do I need to add a calcluated column or a measure to transform my text to a numeric value?

1 ACCEPTED SOLUTION

@SloeMo No, not because it is text because you have the Count aggregation. But, what you need to be using is the %GT of Count of KRI Category. Of course, you probably don't have that available in the conditional formatting stuff. But, you could create a measure like:

GT % Measure = 
  VAR __Count = COUNT('Table'[Count of KRI Category)
  VAR __AllCount = COUNTX(ALL('Table'),[Count of KRI Category])
RETURN
  DIVIDE(__Count,__AllCount,0)


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
SloeMo
Frequent Visitor

@Greg_Deckler 

 

Thanks so much, has worked perfectly. Knew I was missing something.

Lee

Greg_Deckler
Super User
Super User

@SloeMo You should be using the Number dropdown and not Percent. Should be something like if > 0 and <= .45 and > .45 and <= 1

Or something like that.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

thanks @Greg_Deckler 

 

I had tried that previously based on other threads but these are the results.

 

SloeMo_1-1662735835253.png

Am I doing something wrong in the format, it looks like as I am using number as a rule nothing actually falls into the rule parameter as the actual lowest count in the data is 2. I need it work from a % as the numbers will change.

 

Didn't know if this is because the column is text?

 

Thanks

Lee

@SloeMo No, not because it is text because you have the Count aggregation. But, what you need to be using is the %GT of Count of KRI Category. Of course, you probably don't have that available in the conditional formatting stuff. But, you could create a measure like:

GT % Measure = 
  VAR __Count = COUNT('Table'[Count of KRI Category)
  VAR __AllCount = COUNTX(ALL('Table'),[Count of KRI Category])
RETURN
  DIVIDE(__Count,__AllCount,0)


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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.