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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.