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
jalaomar
Helper IV
Helper IV

count rows with conditions

Hi,

 

could someone support with a measure that i would like to create. 

Have the column KPI: VSU 6 Weeks where i have blank rows, rows with value 0 & 1.

how to count rows with value = 1?

 

The measure created gives me an error 

 

2021-11-25_14-33-35.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jalaomar , if KPI: VSU 6 Weeks is column then your formula or below measure should work

 

countrows(filter('KPI', 'KPI'[KPI: VSU 6 Weeks] =1 && not(isblank('KPI'[KPI: VSU 6 Weeks]))))

 

If this a measure 

then you need some unique combination to filter like

countrows(filter(summarize(Table, Table[Cluseter], [Applicant], [Project Id], "_1", [KPI: VSU 6 Weeks] ), [_1] =1 ) )

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@jalaomar , if KPI: VSU 6 Weeks is column then your formula or below measure should work

 

countrows(filter('KPI', 'KPI'[KPI: VSU 6 Weeks] =1 && not(isblank('KPI'[KPI: VSU 6 Weeks]))))

 

If this a measure 

then you need some unique combination to filter like

countrows(filter(summarize(Table, Table[Cluseter], [Applicant], [Project Id], "_1", [KPI: VSU 6 Weeks] ), [_1] =1 ) )

Yes, it is a measure and the suggestion worked 🙂

Many thanks!

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.