Create Query Groups in Power BI

This article shows you the steps required to Create Query Groups in Power BI with an example. In general, the tables that we load from the source are arranged in alphabetical order. However, in real time, we might have to group those tables based on the content.

For example, arrange Dimension tables in one group and fact tables in another. To create the Power BI query group on existing tables, please click the Edit Queries option under the Home tab.

Create Query Groups in Power BI 1

How to Create Query Groups in Power BI

Clicking the Edit Queries option opens a new window called Power Query Editor. Under the Power BI Queries section, you can see the list of available tables.

There are a couple of ways to create a new query group. The first approach to Creating a Power BI Query Group is to right-click on the empty space under the queries section and select the New Group option from the context menu.

Create Query Groups in Power BI 3

Selecting the New Group option will open the following window. Please specify the Group Name and the description. For now, we are assigning the Dimensions as the Group name.

Create Query Groups in Power BI 4

You can see the New Dimensions folder (Query Group).

The first approach to add Tables to Query Groups in Power BI

Right-click on the table that you want to add to open the context menu. Please select the Move to Group option, and then select Group Name, i.e., Dimensions.

Create Query Groups in Power BI 6

Now you can see the DimCustomer table under the Dimensions group.

Create Query Groups in Power BI 7

The second approach to add Tables to Query Groups in Power BI

Drag the required table, and Drop it under the Query group to automatically add that table to the query group. For the demonstration purpose, we are dragging the Dim Employee table to the Dimension group.

Create Query Groups in Power BI 8

Similarly, we added the remaining dimension tables to the Dimension query group.

Create Query Groups in Power BI 9

The second approach to create Power BI Query Groups

To create a new query group, right-click on any table will open the context menu. Please select the Move to Group option, and then select the New Group option.

Create Query Groups in Power BI 10

Selecting the New Group.. option will open the following window. For now, we are assigning the Group names as measures.

Create Query Groups in Power BI 11

Rearranging tables in a Power BI Query Groups

Simply moving the table up and down will change the table position.

Create Query Groups in Power BI 12

Alternatively, right-click on the table that you want to move will open the context menu. Please select the Move Down or Move Up option. For demonstration purposes, we moved the Dim Employee table down.

Create Query Groups in Power BI 13

Now you can see the Dim Employee table in the third position.

Delete Query Groups in Power BI

To delete the existing query group, right-click on the group name will open the context menu. Please select the Delete Group option.

Create Query Groups in Power BI 17

Selecting the Delete Group option opens the message box with the Delete and Confirm buttons. For now, we are clicking the Cancel button.

How to Ungroup Existing Query Groups in Power BI

To ungroup or remove the existing group, right-click on the group name and select the Ungroup option from the context menu.

Create Query Groups in Power BI 18

Now you can see that the Dimensions group removed.

Nested Query Groups in Power BI

To add one group to another group, right-click on the group name to open the context menu. Please select the Move to Group option and then select the Master Group name, i.e., Dimensions.

Create Query Groups in Power BI 20

Now you can see that the Measures Group is Nested inside the Dimensions group. You can undo this by right-clicking the group name and selecting the Move to Top Level option from the context menu

Whatever the changes you made (query groups) won’t affect you until you hit Apply. Let me hit the Close & Apply option under the Home tab.

Create Query Groups in Power BI 22