Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |