How to Fix Power BI CountRows Showing Incorrect Row Count
Question details
The user needs to resolve an issue in Power BI where the CountRows DAX calculation fails to update properly after new data has been uploaded and refreshed.

- Product
- Power BI
- Device & OS
- not provided
- Scenario
- Updating and refreshing a dataset in a Power BI report to reflect newly added data.
- Observed behavior
- The CountRows calculation continues to display the old total number of rows instead of updating to reflect the newly uploaded data.
Before deleting any tables, save a backup copy of your current Power BI Desktop file (.pbix) and ensure you have the correct file path or credentials to reconnect to your data source.
Delete and Re-upload the Data Source
The most effective way to force Power BI to recognize the new row count is to completely remove the problematic table from the data model and reconnect to it.
In some instances, Power BI caches the metadata of your dataset. A standard refresh may pull the new data into the query editor, but the data model might fail to update the structural row count, causing DAX measures like CountRows to return stale numbers.
Open your Power BI report, navigate to the 'Data' pane on the right side of the interface, and locate the specific table that is showing the incorrect row count.
Right-click the table name and select 'Delete from model' from the context menu. Click 'Yes' or 'Confirm' when prompted.
Go to the Home ribbon, click on the 'Get Data' icon, select your original data source type (e.g., Excel workbook, SQL Server), and import the updated dataset.
Once the data finishes loading, check your card visual or table displaying the CountRows measure. The calculation should now display the accurate, updated number of rows.

Clear Power BI Desktop Data Cache
Clearing the local data cache can resolve stubborn refresh glitches without requiring you to completely remove the dataset from your model.
Manage Your Data Seamlessly with WPS Office
If you frequently struggle with complex data analysis tool caching issues, WPS Spreadsheet offers a lightweight and highly compatible alternative. Handle large datasets, perform accurate row counts instantly, and build pivot tables effortlessly without the steep learning curve.
- 1. Download and Install: Download WPS Office for free from the official website and follow the simple installation prompts.
- 2. Open Your Dataset: Launch WPS Spreadsheet and open your existing .xlsx or .csv data file.
- 3. Analyze Easily: Use the built-in ROWS function or highlight your data to instantly view accurate row counts in the bottom status bar.

Frequently Asked Questions
Why does Power BI not update the row count after a normal refresh?
Power BI may cache old data metadata to improve performance. Additionally, the refresh might fail silently due to query folding limitations or minor connection errors, causing DAX measures like CountRows to display outdated figures from the cache.
Is there a DAX alternative to the CountRows function?
Yes. You can use COUNT(Table[ColumnName]) to count the number of non-blank values in a specific column, or COUNTA for non-empty text values. These column-specific functions can sometimes bypass table-level caching issues.
Will deleting the data source permanently break my existing visuals?
Deleting a table from the model will temporarily break any visuals relying on it. However, when you re-upload the table, as long as it has the exact same table name and column headers, Power BI will map the fields correctly and the visuals will be restored.




