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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.