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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Count number of lines, by excluding records with zero value

Dear All,

 

I am importing a small Excel file into a Power BI report. 

 

In a table I want to show the total number of records, where I don't want to take the record into account with a zero value

 

Simplified the following situation:

 

Excel file imported:

Line Number
13
20
38

 

Desired output in Power BI table:

 

Number of records
2

 

When I use the regular conditions (selecting 'Count' in the tabel format, I will receive an output of number of records of 3 (counting the records). 

 

Any suggestion?

 

Kind regards,
Reinier

 

1 ACCEPTED SOLUTION
rocky09
Solution Sage
Solution Sage

Try this one

count = CALCULATE(COUNT('table'[Number]),'table'[Number] <> 0)

View solution in original post

1 REPLY 1
rocky09
Solution Sage
Solution Sage

Try this one

count = CALCULATE(COUNT('table'[Number]),'table'[Number] <> 0)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.