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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

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

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.

Anonymous
Not applicable

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors