Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Dear fellow Power BI user,
What is the difference between Power Query and the Query Editor?
It seems like an easy question but the more I search the more confused I get. As I understand it now the Query Editor is the screen in which I can process all kind of data transformations. I can access this Query Editor via the button "Transform Data" in Power BI Desktop via the Home ribbon.
However it is still unclear to me what Power Query is (or what it refers to). Can someone help me out?
Many thanks in advance!
Best regards,
Luuk Holtappels
Whichever method you pick, `Power Query` is always used to import the data. Hitting ok verses transform changes whether it opens the `query editor` window first. At any time you can reopen the editor.
Quick Terms:
- Query editor: this shows the "fx equation bar", and a UI to generate the majority of the code.
it shows 1 single line per "step name"
- `Advanced Editor` This is a button in the Query Editor , showing you the full query on one screen.
It's the exact same code without the UI.
-----
Say this is your full query in the query editor
let
Source = ...,
#"Add Column Double" = Table.AddColumn( Source, "Doubles", each [Number] * 2 )
in
#"Add Column Double"
fff
In the query editor on the 2nd step, it shows
= Table.AddColumn( Source, "Doubles", each [Number] * 2 )
and add custom column only shows
each [Number] * 2
But that step is really
= Table.AddColumn( Source, "Doubles", each [Number] * 2 )
The UI doesn't show the datatype argument
If I were writing it, I include column types when they are known.
One issue is using `each` causes it to return `type any`
That means the next step you have to redo column transform -- but it's already a number
so I expand `each`, and add the 4th parameter
= Table.AddColumn( Source, "Doubles", (row) as number => row[Number] * 2, type number )
`(row) as number` uses the `as` type operator which asserts (enforces) the datatype to be number, it will error if it's text or a table or anything
You can use other types like
- Int64.Type, Currency.Type, `type any`, `type text`, etc..
hi @luukholtappels ,
Yes, transform data enables you to reach the power query editor.
In my opinion, Power Query is just a tool which is run on the underlying "M" Language.
Power Query M enables us to perform Transformtions Operations using various functions and formulae.
The Power Query Editor is a workspace/sandbox enabling ETL processes with a user friendly UI.
here are some reference links:
Power Query M formula language reference - PowerQuery M | Microsoft Learn
Getting started with Query Editor in Power BI Desktop (sqlshack.com)
Best Practises: Best practices when working with Power Query - Power Query | Microsoft Learn
Appreciate a thumbs up if this is helpful.
Let me know if it resolves your question.