Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, I want to pull data from a table in a database with this statement.
It works, but returns only the records with the first datetime in the 'IN' clause (08/27/2024 03:34:05).
For information: the list with datetimes is generated dynamically with data from another table.
I am sure that there are records in the table that should be returned.
So why it stucks to the first datetime in the list and ignores the others?
Select DateTime, Tagname, Value FROM table WHERE TagName='P124' OR Tagname='P132' AND DateTime IN ('08/27/2024 03:34:05', '08/27/2024 02:07:46', '08/27/2024 03:30:05')
Solved! Go to Solution.
Use ISO-8601 formatting, always.
You need to protect the OR part from the AND part.
Select DateTime, Tagname, Value FROM table WHERE TagName IN ('P124' ,'P132') AND DateTime IN ('08/27/2024 03:34:05', '08/27/2024 02:07:46', '08/27/2024 03:30:05')
Use ISO-8601 formatting, always.
You need to protect the OR part from the AND part.
Select DateTime, Tagname, Value FROM table WHERE TagName IN ('P124' ,'P132') AND DateTime IN ('08/27/2024 03:34:05', '08/27/2024 02:07:46', '08/27/2024 03:30:05')
Check out the July 2025 Power BI update to learn about new features.