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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Kirt1965
Helper III
Helper III

Get a count of filtered items meeting a certain condition

Hello All,

 

Still new to Power BI, so apologies if what I’m asking is super easy. 

 

We are comparing current period hours worked to previous period hours worked per employee.  Each employee has a manager, director, and VP.  I have measures set up that work.  They are below.  I have a filter on the page for the previous calendar month we call the current period (not in code, I don’t know if that matters) to show only those where the percent change is 10% or more.

 

What I want is a count of instances meeting that condition (> 10%).  So for the limited example data below, where VP=VP1 the total count would be 2.  Count for Director1 = 2.  Count for Manager1 and 3 = 1 each, but count for Manager2 = 0.  This is for a chart that shows the counts at each level; VP, Director, Manager, etc. and Drillable.

 

I’m sure the way my instinct tells me to go is wrong – which is to flag a condition met as 1 and not met as 0 then sum the flag values. 

 

Any help on how I should REALLY do this would be greatly appreciated.

 

Thank you,
Kirt
----------------

Current Period OT Hours  = SUM(TIMECHARGE[Hours])

Previous Period OT Hours = CALCULATE([Current Period OT Hours], DATEADD(DateTable[Date],-1,MONTH))

Percent Change           = DIVIDE([OT Hours Change],[Previous Period OT Hours],BLANK())

 

VPDIRECTORMANAGEREMPLOYEECURRENT PERIOD HOURSPREVIOUS PERIOD HOURSPERCENT CHANGEINCLUDE IN COUNT
VP1Director1Manager1Employee1504025%1
VP1Director1Manager1Employee23040-25%0
VP1Director1Manager2Employee342405%0
VP1Director1Manager3Employee4444010%1
VP1Director2Manager4Employee5.......   
.......       
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Kirt1965 try this measure for count

 

Count over 10 Percent = 
COUNTX ( VALUES ( Table[Employee] ), IF ( [% Change Measure] >= .10, 1 ) )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@Kirt1965 try this measure for count

 

Count over 10 Percent = 
COUNTX ( VALUES ( Table[Employee] ), IF ( [% Change Measure] >= .10, 1 ) )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you for the help.  I had to play with what to put in for Table[Employee], but it looks like it is working now.  I appreciate it.

 

Kirt

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.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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