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
Anonymous
Not applicable

Wonderware INSQL Historian

i am using wonderware historian which based on INSQL(industrial SQL ) bewlow query to retrive certain tag ('mesCANFiller02.stOperatingState')

i have to specifiy startdata and Enddata in my query as fixed value to let this query work .

My question . how can i make this query dynmaic means link this query with slicer. 

 

 

SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = DateAdd(hh,-24,GetDate())
SET @EndDate = GetDate()
SET NOCOUNT OFF
SELECT  * FROM (
SELECT History.TagName, DateTime, Value, vValue, StartDateTime
FROM History
WHERE History.TagName IN ('mesCANFiller02.stOperatingState')
AND wwRetrievalMode = 'Delta'
AND wwQualityRule = 'Extended'
AND wwVersion = 'Latest'
AND DateTime >= @StartDate
AND DateTime <= @EndDate) temp WHERE temp.StartDateTime >= @StartDate
ORDER BY DateTime DESC

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Anonymous,

 

It is impossible to send slicer selection data to query editor as filter parameter.

 

Date levels:

Database -> Power query(query table, query parameter, custom function) -> Data model(calculated column/table, RLS) -> Data view(measure, visual , slicer)

 

Notice: Parent level can affect child but child is impossible to affect its parent.

 

For your scenario, you can only use query parameter to get dynamic result table.

Deep Dive into Query Parameters and Power BI Templates

 

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

2 REPLIES 2

Hi @Anonymous ,

 

This is a late reply but there is a quicker and more user friendly to conenct to Wonderware historians (and many, many more). Check this blog post in Power BI Community Blog.

v-shex-msft
Community Support
Community Support

HI @Anonymous,

 

It is impossible to send slicer selection data to query editor as filter parameter.

 

Date levels:

Database -> Power query(query table, query parameter, custom function) -> Data model(calculated column/table, RLS) -> Data view(measure, visual , slicer)

 

Notice: Parent level can affect child but child is impossible to affect its parent.

 

For your scenario, you can only use query parameter to get dynamic result table.

Deep Dive into Query Parameters and Power BI Templates

 

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.