Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to Solution.
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
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.
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |