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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
lyrana
New Member

Help with direct query

Hello,

Goal: generate graphs to show our app insights data such as % processor time averaged daily 

  We have about 30.1 million records for perf counters in an Azure SQL DB. I'm new to power bi and I couldn't understand in the UI how to do a datediff to have it group by daily periods and average the value. 

I have a stored proc that I use in SQL:

 

select
DATEADD(day, T2.DailyPeriods, '2016-01-01T00:00:00') as Date,
T2.AvgValue
FROM
(
select
T1.DailyPeriods,
AVG(T1.val) as AvgValue
From
(
select
datediff(DAY, '2016-01-01T00:00:00',[eventTime]) AS DailyPeriods,
[value] AS val
from
dbo.[PerformanceCounters]
WHERE [instance] = '_Total'
)
as T1
GROUP BY T1.DailyPeriods
)
T2
order by Date

 

when I try to load that through the dq option I get "the order by clause is invalid in views, inline funcitons... unless top offser or for xml is also specified"

 

Your assistance is appreciated. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lyrana,

 

Current power bi not support to invoke sp in directquery mode, it only works in import mode.

For detail information, you can refer to below article:
Call an SP

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @lyrana,

 

Current power bi not support to invoke sp in directquery mode, it only works in import mode.

For detail information, you can refer to below article:
Call an SP

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.