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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Noredlac86
Helper I
Helper I

Count repeated values with a condition

Hi Everyone.
I waswondering if someone one can help me with this doubt.

 

I have a table with the name of the employees, and the column, Employe of the month = Yes/No.

 

I need to count, how many times of the year, the user was employee of the month.

 

For example:

 

ID    NAME     EMPLOYEEOFMONTH?     HOW MANY TIMES?

5    Jhon                  Yes                                        2

5     jhon                  No                                        2
6    Ana                    No                                       0
7    Marc                  Yes                                       3
5   Jhon                    Yes                                      2
7  Marc                     Yes                                      3
7 Marc                     Yes                                      3


The idea is to create the column "How many times?

iwas wondering if someone can help me

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Noredlac86 Maybe:

How many times column =
  VAR __id = [ID]
  VAR __table = FILTER(ALL('Table'), [ID] = __id && [EMPLOYEEOFMONTH?] = "Yes")
RETURN
  COUNTROWS(__table)


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...

View solution in original post

3 REPLIES 3
Noredlac86
Helper I
Helper I

@Greg_Deckler  i have a hard question for you. This is so dificult, but not sure if you have time to check:

https://community.powerbi.com/t5/Desktop/Power-BI-DAX-count-using-multiple-and-hard-conditions/m-p/2...

Really appreciate your feedback

Greg_Deckler
Community Champion
Community Champion

@Noredlac86 Maybe:

How many times column =
  VAR __id = [ID]
  VAR __table = FILTER(ALL('Table'), [ID] = __id && [EMPLOYEEOFMONTH?] = "Yes")
RETURN
  COUNTROWS(__table)


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 i have tested and i just wanna say THANKS!!!!!
Thanks for take your time to reply my message is working fine, u rock!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.