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
lnayak
Frequent Visitor

Create a Measure to Count based on a condition

Hi,

 

So i have a PowerPivot and i need to create a Measure to count the values based on a specfic value that is in the column and also to count only items that fall under certian category. So basically it is Countif function but am stuck here. I have done only Count function but how do i insert the if condition part here 

lnayak_0-1648651990029.png

so i have the above data and i have created a measure called 'Bill Rate Over Max'

lnayak_1-1648652062042.png

I now want this measure to count all the workers that has 'Bill Rate Over Max' which i have done as shown below

=calculate(count(EDE[Worker]),EDE[Max over Bill Rate?]="Bill Rate Over Max")

But now i want to add another condition which is if the 'Invoice Option' is "Staffing" it has to give the result for the same. For now this formula is calculating values for workers on

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use below formula

=calculate(count(EDE[Worker]),EDE[Max over Bill Rate?]="Bill Rate Over Max",EDE[Invoice Option]="Staffing")

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Use below formula

=calculate(count(EDE[Worker]),EDE[Max over Bill Rate?]="Bill Rate Over Max",EDE[Invoice Option]="Staffing")

Thank you @Vijay_A_Verma , this worked!

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.