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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
geroagostini
Helper I
Helper I

Need to count a column if another has a value (similar to Count if)

Hi!

 In the same table ("Table Z") i have 2 columns: Column A and Column B.

 Column A                   Column B

     done                          7261

    approved                    12

     done                          290

     on work                     913

     approved                   6100

     on work                     2000

 

 I need to count the values of Column B only when Column A is = "done"

 Could someone please help me? 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @geroagostini 

are you expecting a measure like this:

Measure =
CALCULATE(
    SUM(TableZ[Column B]),
    TableZ[Column A] = "done"
)

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @geroagostini 

are you expecting a measure like this:

Measure =
CALCULATE(
    SUM(TableZ[Column B]),
    TableZ[Column A] = "done"
)

thanks a lot!

geroagostini
Helper I
Helper I

Why this doesnt work?

Medida 2 = CALCULATE(
   COUNT('Table Z'[Column B]),
   filter('Table Z','Table Z'[Column A]<>"Done"))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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