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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Miss
Frequent Visitor

DirectQuery orders by day from DateTime Field

I'm trying to produce a report to show the number of orders placed by day, using directQuery so we have the report as live as possible

 

The Data I have access to for a report gives the date and time an order was placed:

 
 
OrderIDCreatedAt
00000000412/03/2020 09:46:26
00000000512/03/2020 15:04:05
00000000613/03/2020 15:06:29
00000000713/03/2020 15:17:56
00000000813/03/2020 15:42:51
00000000916/03/2020 12:34:10
00000001016/03/2020 12:51:34

 

As this is a direct query, it will not allow me to convert this to a date field. I've also tried to split the column but this is not supported either.

 

When I create a visual to show the number of orders per day, it displays each order individually due to the unique timestamps, rather than grouping by day

 

Has anyone got any workarounds that would help to convert the createdAt field to a date only field? Or any other clever but simple ideas?!

 

Im using a custom connector and I have no ability to change to original data source to meet my requirements!

 

Any help would be most appreciated!

 

Thanks

1 ACCEPTED SOLUTION

HI @Miss,

Maybe you can consider using odbc driver or web connection with rest API to instead.

ODBC Driver:

Connecting to Magento from Microsoft Excel using ODBC Driver for Magento  

ODBC Data Sources, The SqlCapabilities Option And Power Query/Power BI Data Refresh Performance 

Web connector:

Magento - Getting Started with Web APIs 

Get Data from Twitter API with Power Query
Power BI – Connect to your secure API

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @Miss,

What type of data source are you test? Did this support SQL statements or other query string options? I'd like to suggest you write a query with sort functions instead changes them on power bi side. 

Refresh data from an on-premises SQL Server database 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I'm using a CData Connector to connect to magento. I cant use a custom sql statement with this connector on direct query unfortunately.

 

Is there any other way to amend the sql where I could change it after I've created the connection?

 

 

HI @Miss,

Maybe you can consider using odbc driver or web connection with rest API to instead.

ODBC Driver:

Connecting to Magento from Microsoft Excel using ODBC Driver for Magento  

ODBC Data Sources, The SqlCapabilities Option And Power Query/Power BI Data Refresh Performance 

Web connector:

Magento - Getting Started with Web APIs 

Get Data from Twitter API with Power Query
Power BI – Connect to your secure API

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
camargos88
Community Champion
Community Champion

Hi @Miss ,

 

How are you submitting this query ?

Can't you format your date column on select ?

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.