Power BI – Query Overview
In Power BI Desktop, a query is a process that retrieves data from a data source and loads it into the report. Queries are used to define the data that will be used in a report, and they can be manipulated to clean, transform, and aggregate the data as needed.
When you connect to a data source in Power BI Desktop, a query is automatically created that retrieves all the data from the data source. You can then modify the query to only include the data you need, or to perform transformations on the data, such as renaming columns, filtering rows, or grouping data.
To modify a query in Power BI Desktop, you use the Query Editor. The Query Editor is a visual interface that allows you to perform various transformations on the data. Here’s an overview of the steps involved
- Open Power BI Desktop and connect to the data source you want to modify.
- Go to “Home” > “Transform Data” in the ribbon.
- In the Query Editor, you will see a preview of the data from the data source. You can perform various transformations on the data, such as
- Renaming columns
- Filtering rows
- Grouping data
- Replacing values
- Merging queries
- To perform a transformation, simply select the transformation you want to perform from the ribbon, and follow the prompts.
- Repeat the process of applying transformations until you have the data you need.
- Once you have the data you need, click “Close & Apply” to close the Query Editor and apply the changes to the report.
Note that the specific steps may vary depending on the version of Power BI Desktop you are using and the type of transformation you want to perform. However, the basic process is the same and should provide a good starting point for modifying queries in Power BI Desktop.
Data can be accessed, reports can be created, and they can be shared – so others can expand their business intelligence efforts by building on your work.
Power BI Desktop has three views
Report view – Create compelling visualizations with queries, arranged as you wish, with multiple pages, that you can share.
Data view – Use this view to see the data in your report in a data model format, where you can add measures, create columns, and manage relationships.
Model view – Visualize the relationships established in your data model and manage or modify them accordingly.
On the left side of Power BI Desktop, you can access these views by selecting one of the three icons. The yellow band beside the icon indicates that Report view is selected in the following image.
Power BI Desktop also includes Power Query Editor. Power Query Editor lets you connect to one or more data sources, shape and transform the data, then load that model into Power BI Desktop.