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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Measure for count

Hi

I need a measure that will count. The column is sorted by colors (orange, yellow, blue, green). I need a measure that will count and add up all the blue and green and divide by the total number of all colors blue,green,yellow, orange. Idea of what I need below:

 

I need a measure that adds the 5 blue+7 green / 15 (all the colors included)

 

bossyr94_0-1651602990116.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Try this meausre

Measure = var _blue=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Blue"))
var _green=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Green"))
var _total=CALCULATE(COUNT('Table'[Color]),ALL('Table'))
return DIVIDE(_blue+_green,_total)

vstephenmsft_0-1651829759134.png

 

Best Regards,

Stephen Tao

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Try this meausre

Measure = var _blue=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Blue"))
var _green=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Green"))
var _total=CALCULATE(COUNT('Table'[Color]),ALL('Table'))
return DIVIDE(_blue+_green,_total)

vstephenmsft_0-1651829759134.png

 

Best Regards,

Stephen Tao

 

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

speedramps
Super User
Super User

Hi bossyr94

 

YourAnswer =

VAR colurcount =  COUNT(Table[colour]) =  COUNT(Table[color])

VAR allcolourcount =  CALCULATE(COUNT(Table[color]),ALL())
RETURN
DIVIDE(colurcount, allcolourcount )

Create table visual with

Colour, count of colur and [YourAnswer]

 

Please click thumbs up and Accept as Solution. Thak you 😀

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.