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
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
v-shex-msft
Community Support
Community Support

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

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

1 REPLY 1
v-shex-msft
Community Support
Community Support

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

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

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.