Sample Header Ad - 728x90

SQL Dynamic Query based on user input in PowerBI

2 votes
1 answer
778 views
I am pulling data from inSQL using the SQL Query below:
SET QUOTED_IDENTIFIER OFF

SELECT * FROM OPENQUERY(INSQL, "SELECT DateTime, [X],[Y], [Z], [A]

FROM WideHistory

WHERE wwRetrievalMode = 'Cyclic'

AND wwResolution = 1000

AND wwVersion = 'Latest'

AND DateTime >= '20210601 20:02:33.000'

AND DateTime <= '20210607 20:02:34.000'")
I'm using this table in PowerBI and want [X],[Y], [Z], [A] & the DateTime values to dynamically change based on user input. Any advice on this would be greatly appreciated. I am new to PowerBI and SQL.
Asked by Felix Silva (21 rep)
Jun 21, 2021, 01:02 AM
Last activity: Jul 6, 2022, 11:00 PM