Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Greetings,
I am running the following query in PowerBi. It works well, but I need to pull data from another table, and add it to the output. highlighted below is the table & columns I want to extract data from.
let
Source = Sql.Database("DCSQLPA01", "Operations", [Query="SELECT TOP (100) PERCENT RTRIM(r.Name) AS rName, pr.Type, pr.Sequence, d.ParkRideID, pr.RideName, DATEDIFF(minute, d.TimeDown, d.TimeUp) AS DownTimeMins, d.TimeDown, d.TimeUp, s.Name, RTRIM(d.Reason) AS Reason, #(lf) RTRIM(d.Resolution) AS Resolution, RTRIM(d.Comments) AS Comments, pr.ParkID, p.Name AS Expr1#(lf)FROM dbo.ParkRideDowntimes AS d INNER JOIN#(lf) dbo.ParkRides AS pr ON pr.ID = d.ParkRideID INNER JOIN#(lf) dbo.Parks AS p ON pr.ParkID = p.ID INNER JOIN#(lf) dbo.DowntimeSubtypes AS s ON d.DowntimeSubtypeID = s.ID INNER JOIN#(lf) dbo.Rides AS r ON pr.RideID = r.ID#(lf)WHERE (d.timedown between '2019-05-03' and '2019-05-11') or (d.timedown between '2020-05-03' and '2020-05-11') or (d.timedown between '2021-05-03' and '2021-05-11')"]),
#"Sorted Rows" = Table.Sort(Source,{{"TimeDown", Order.Descending}})
in
#"Sorted Rows"
I want to pull three columns and have them be in the report.
Date
TimeOpen
TimeClose
From:
DCSQLPA01.Operations.dbo.ParkDailySchedules
I tried just adding it to the query, then tried a join. Neither worked. Hoping one of you folks knows how to write the statement I can add to my query.
Hi @Anonymous
What is the relationship between ParkDailySchedules table and other tables already in your query? Is there any field we can use to join the query?
Regards,
Community Support Team _ Jing
I know there is a field called ParkID that is used in both Tables, would that work?
I see you already have multiple joins in your query. Why can't you just join on DCSQLPA01.Operations.dbo.ParkDailySchedules and select the 3 columns you need? Try the query with this new join directly on the SQL server for testing purposes. If it works, then you shouldn't face any issue importing it to Power BI
I tried that, maybe I am writing the the statement incorrectly?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
39 | |
20 | |
19 | |
13 | |
12 |