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.
I am developing reports in PowerBI for data which resides in an Amazon redshift instance. I write the query on the server, then import it into PowerBI. There are no stored procedures available, so I can't go this route. My question is - how do I edit the query from the report? I write the query so it looks like this:
SELECT
pwc.poll_worker_id AS "Pollworker ID",
pw.first_name AS "Pollworker First Name",
pw.last_name AS "Pollworker Last Name",
pp.name AS "Polling Place",
pp.code AS "Polling Place Code"
FROM
public.poll_worker_checkins AS pwc
INNER JOIN
public.poll_workers AS pw ON pw.id=pwc.poll_worker_id
INNER JOIN
public.polling_places AS pp ON pp.id=pwc.assigned_polling_place_id
WHERE
pwc.election_id=460
ORDER BY
pwc.poll_worker_id
But then after I load it in PowerBI and go to Power Query Editor, I get this:
= Value.NativeQuery(AmazonRedshift.Database("redshift.amazonaws.com","epulse"), "SELECT#(lf)#(tab)pwc.action as ""Action Type"",#(lf)#(tab)pwc.time as ""time of checkin/out"",#(lf)#(tab)pwc.poll_worker_id as ""Pollworker ID"",#(lf)#(tab)pw.first_name as ""Pollworker First Name"",#(lf)#(tab)pw.last_name as ""Pollworker Last Name"",#(lf)#(tab)#(tab)-- FORMAT(pwc.time, 'hh:mm') as ""time of checkin/out"",#(lf)#(tab)pp.name as ""Vote Center"",#(lf)#(tab)pp.code as ""Vote Center Code""#(lf)FROM#(lf)#(tab)public.poll_worker_checkins as pwc#(lf)inner JOIN#(tab)#(lf)#(tab)public.poll_workers as pw on pw.id=poll_worker_id#(lf)INNER JOIN#(lf)#(tab)public.polling_places AS pp ON pp.id=pwc.assigned_polling_place_id#(lf)WHERE#(lf)#(tab)pwc.election_id=460#(lf)ORDER BY#(lf)#(tab)pwc.poll_worker_id", null, [EnableFolding=true])
Solved! Go to Solution.
Typically if you click on the gear icon next to the source step, it gives you a more formatted version of the text there, without all of the #(lf)s. Unsure if the Redshift connection will, but I've used this with SQL Server for sure.
Yes, it worked perfectly. I now need to figure out if I can make stored procedures in Amazon Redshift. I despise having in-line code and much prefer stored procs to make coding easier. (Don’t worry about that gripe, I need to take it up with our vendor, who chose Amazon instead of SQL Server.)
Wonderful! Thank you so much!!!
Typically if you click on the gear icon next to the source step, it gives you a more formatted version of the text there, without all of the #(lf)s. Unsure if the Redshift connection will, but I've used this with SQL Server for sure.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |