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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Count when the row has value

I have a table like this. 

 

PersonM1M2M3M4
Peter1000
Jane0000
Tom1010
Mary1110

 

I want to count rows when at least one of the M1, M2, M3, and M4 has value.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can create a measure as follows:

 

PeopleCount = CALCULATE(

    DISTINCTCOUNT(TableName[Person]), 

    FILTER(ALL(TableName), TableName[M1] + TableName[M2] + TableName[M3] + TableName[M4] >= 1)

)

 

BTW, I recently developed this Power BI Smartable android app

I appreciate it if you can try it and share any feedback.

powerbi.png

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous

In your table ALL rows do have a value in ALL columns...
amitchandak
Super User
Super User

@Anonymous , Try a measure

row count =countrows(filter(Table, Table[M1] +Table[M2]+Table[M3]+Table[M4] >0))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

You can create a measure as follows:

 

PeopleCount = CALCULATE(

    DISTINCTCOUNT(TableName[Person]), 

    FILTER(ALL(TableName), TableName[M1] + TableName[M2] + TableName[M3] + TableName[M4] >= 1)

)

 

BTW, I recently developed this Power BI Smartable android app

I appreciate it if you can try it and share any feedback.

powerbi.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors