Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi all,
I want to use count function in direct query mode.
I'm unable to use it. The formula does not return an error.
Measure = COUNT('Bölge Yöneticisi'[Bölge Yöneticisi Düzey 01])when i try to use it on chart I'm getting this error.
Solved! Go to Solution.
Firstly, when you're working with DirectQuery in Power BI, you have to remember that not all DAX functions behave the same way as they do in Import mode. DirectQuery sends the DAX calculations as native SQL queries to the source database, so there might be some limitations based on the database you're connected to.
The formula you provided, Measure = COUNT('Bölge Yöneticisi'[Bölge Yöneticisi Düzey 01]), seems straightforward. However, since you're getting an error when trying to use it on a chart, there might be a few reasons for that:
The column 'Bölge Yöneticisi Düzey 01' might have some blank or NULL values. In DirectQuery mode, handling of these values might be different. You might want to try the COUNTA function instead of COUNT if there are non-numeric values in the column.
The data type of the column might be causing an issue. Ensure that the column's data type is appropriate for counting.
There might be a compatibility issue with the underlying database. Some databases might not support certain DAX functions directly. In such cases, you might need to create a custom SQL query or view on the database side and then connect to that view/query in Power BI.
Lastly, ensure that there's no issue with the connection itself. Sometimes, connectivity issues or timeouts can lead to errors when trying to render visuals.
If you've tried all of the above and still face the issue, it would be helpful to know the exact error message you're getting. That would give more context on what might be going wrong. Also, always keep an eye on the Power BI documentation and forums, as they often have solutions for common issues faced by users.
Firstly, when you're working with DirectQuery in Power BI, you have to remember that not all DAX functions behave the same way as they do in Import mode. DirectQuery sends the DAX calculations as native SQL queries to the source database, so there might be some limitations based on the database you're connected to.
The formula you provided, Measure = COUNT('Bölge Yöneticisi'[Bölge Yöneticisi Düzey 01]), seems straightforward. However, since you're getting an error when trying to use it on a chart, there might be a few reasons for that:
The column 'Bölge Yöneticisi Düzey 01' might have some blank or NULL values. In DirectQuery mode, handling of these values might be different. You might want to try the COUNTA function instead of COUNT if there are non-numeric values in the column.
The data type of the column might be causing an issue. Ensure that the column's data type is appropriate for counting.
There might be a compatibility issue with the underlying database. Some databases might not support certain DAX functions directly. In such cases, you might need to create a custom SQL query or view on the database side and then connect to that view/query in Power BI.
Lastly, ensure that there's no issue with the connection itself. Sometimes, connectivity issues or timeouts can lead to errors when trying to render visuals.
If you've tried all of the above and still face the issue, it would be helpful to know the exact error message you're getting. That would give more context on what might be going wrong. Also, always keep an eye on the Power BI documentation and forums, as they often have solutions for common issues faced by users.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 7 | |
| 6 | |
| 6 |