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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
eiashken
Microsoft Employee
Microsoft Employee

cosmosdb in PowerBI SQL Statement

I have been trying to add an SQL statement during CosmosDB connection to save time and performance in aggregation.
I got an error that says that I have an error in my errors table..
But the query works in cosmosDB!
Only in POWerBI I have this error... why?
 
SELECT SUBSTRING(c.created, 0, 7) as month,c.status,count(1) as count
FROM c
group by SUBSTRING(c.created, 0, 7),c.status
3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @eiashken

 

What is the error you are getting?In which connection mode do you choose before connecting to CosmosDB?"Import "or "Directquery"?

 

Best Regards,

Kelly

Where can I choose these options?

Hi @eiashken

 

Try the following steps to do the troubleshooting:

 

1.If you dont add the statement, is it available to connect the data source?

2.Have you installed  Cosmos DB ODBC driver?Are you using ODBC Connector in desktop such as below?

 For references,pls click here.

 

 11.png
 
Do check all the questions above,if there still has some errors ,pls advise me what the error you are getting?
 
Best Regards,
Kelly
 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.