cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Regular Visitor

## DAX Measure to count row with particular background cell color.

Hello PBI community, I have a table with a column contains different color of cells, I want to write a DAX measure to count a particular cell color. For eg. the Column name is Contract and has a different color like Red, Blue, Green, Yellow. Ideally, I want to count row the number of cells with a yellow specific color in a card visual. Can anyone from the community give me a hand to create a DAX measure?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV

## Re: DAX Measure to count row with particular background cell color.

Hi @mandy_nair ,

You will have to have a unique identifier for each color.  If you table is simple, you could create a new column, and write yellow, green, etc. Then  CALCULATE (Countrows(Your Table Name) , Your Table Name[Color Column = "Yellow").

If it is extensive, follow this video that shows you a quick way to find the numerical rendering of a color and fill the column in with a unique number. https://www.youtube.com/watch?v=cbfLU1s2V6U. Then instead of "Yellow" you will use that number.

You can then drop that measure on a card.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

1 REPLY 1
Super User IV

## Re: DAX Measure to count row with particular background cell color.

Hi @mandy_nair ,

You will have to have a unique identifier for each color.  If you table is simple, you could create a new column, and write yellow, green, etc. Then  CALCULATE (Countrows(Your Table Name) , Your Table Name[Color Column = "Yellow").

If it is extensive, follow this video that shows you a quick way to find the numerical rendering of a color and fill the column in with a unique number. https://www.youtube.com/watch?v=cbfLU1s2V6U. Then instead of "Yellow" you will use that number.

You can then drop that measure on a card.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

## Helpful resources

Announcements

#### Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

#### Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors