Clicky

How To Easily Count Rows That Are Not Blank in Power BI

how-to Jan 30, 2024
How To Easily Count Rows That Are Not Blank in Power BI
Profile Image
Hi, I'm Tom Blessing. I'm an expert at helping small to mid-sized companies adopt Power BI. I'm also a recovering investment banker, with deep experience applying technology to otherwise manual data problems. I have dual degrees in Finance and Technology Management from Indiana University.

Resources to help build your fundamentals: Learning Power BI? Data fundamentals are critical for this process to be easier. I've assembled a few DataCamp courses to help.

Introduction to Power BI course: Master Power BI basics and learn to build impactful reports.

Exploratory Data Analysis in Power BI course: Learn about Power BI's Exploratory Data Analysis (EDA) and enhance your reports.

Introduction to SQL course: Learn how to create and query relational databases using SQL in just two hours.

Introduction to DAX course: Learn the fundamentals of Data Analysis Expressions (DAX) such as calculated columns, tables, and measures.

Database Design course: Learn to design databases in SQL to process, store, and organize data in a more efficient way.

Also - need better equipment? For my loyal audience in India, check out Lenovo India.

I earn a small commission on these links if you click and purchase.


Data analysis in Power BI often requires counting non-blank rows, a fundamental task that helps you understand the completeness of your data and identify areas that may need attention.

In this blog post, we'll explore how to count non-blank rows in Power BI using Data Analysis Expressions (DAX).

The Significance of Counting Non-Blank Rows

Counting non-blank rows is essential for several reasons:

  1. Data Quality Assessment: It allows you to assess data quality by identifying missing or incomplete information.

  2. Calculating Data Completeness: You can quantify the completeness of your data, helping you determine if additional data collection or cleaning is necessary.

  3. Filtering Data: Counting non-blank rows can be used as a filter criterion in your analysis, focusing on relevant and complete data.

Counting Non-Blank Rows in Power BI using DAX

To count non-blank rows in Power BI, you can use the COUNTROWS and FILTER functions in DAX. Here's how to do it:

  1. Create a New Measure: In Power BI Desktop, navigate to the "Model" view, select the table containing the column you want to count non-blank rows from, right-click on the table, and choose "New Measure."  

  2. Write the DAX Expression: In the formula bar, write a DAX expression to count the non-blank rows in the selected column. Here's an example:

    Count Non-Blank Rows = COUNTROWS(FILTER('Table', NOT(ISBLANK('Table'[Column]))))
    • Replace 'Table' with the actual name of your table.
    • Replace 'Column' with the name of the column you want to count non-blank rows from.

    The FILTER function filters the table to include only rows where the specified column is not blank (NOT(ISBLANK(...))). The COUNTROWS function then counts the filtered rows.  

  3. Use the Measure in Visuals: Once you've created the measure, you can use it in your visuals. Drag and drop the measure into cards, tables, or any other visualization to display the count of non-blank rows. 

Benefits of Counting Non-Blank Rows

  1. Data Quality Assessment: Identifying non-blank rows helps you assess data quality and completeness.

  2. Focused Analysis: Using non-blank row counts as a filter criterion allows you to focus your analysis on complete and relevant data.

  3. Data Cleanup: Discovering missing or incomplete data points can trigger data cleaning and collection efforts to improve data quality.

  4. Effective Reporting: Displaying non-blank row counts in your reports enhances data transparency and accountability.

Conclusion

Counting non-blank rows in Power BI is a fundamental data analysis task that supports data quality assessment and focused analysis.

By following the steps outlined in this guide and leveraging DAX expressions, you can quantify the completeness of your data, identify areas for improvement, and enhance the overall quality of your reports and dashboards.

 

Read more:
Difference Between Power BI and Automate: How To Know When To Use Each One
Can Power BI Have Multiple Data Sources? Use This Massive Feature For Better Results
Confused? Here's the Difference Between Power BI and Power Platform
Power BI Publish Not Working? How to Fix Common Issues and Get Your Reports Out There
Smash This Annoying Problem: Power BI Freezes When Publishing

Download My Free Guidebook

The 3-Step Plan for Getting Started With PowerBI

Learn the best way I've helped large and small companies adopt the best analytics tool you've ever seen. In this FREE guide, I'll show you my complete startup strategy for Power BI.

We hate SPAM. We will never sell your information, for any reason.