Tutorial: Create a query with the visual query builder
Applies to: ✅ SQL analytics endpoint and Warehouse in Microsoft Fabric
Create and save a query with the visual query builder in the Microsoft Fabric portal.
Use the visual query builder
From the Home tab of the ribbon, select New visual query.
Drag the
fact_sale
table from the Explorer to the query design pane.Limit the dataset size by selecting Reduce rows > Keep top rows from the transformations ribbon.
In the Keep top rows dialog, enter
10000
.Select OK.
Drag the
dimension_city
table from the explorer to the query design pane.From the transformations ribbon, select the dropdown next to Combine and select Merge queries as new.
On the Merge settings page:
In the Left table for merge dropdown list, choose
dimension_city
In the Right table for merge dropdown list, choose
fact_sale
Select the
CityKey
field in thedimension_city
table by selecting on the column name in the header row to indicate the join column.Select the
CityKey
field in thefact_sale
table by selecting on the column name in the header row to indicate the join column.In the Join kind diagram selection, choose Inner.
Select OK.
With the Merge step selected, select the Expand button next to
fact_sale
on the header of the data grid then select the columnsTaxAmount
,Profit
, andTotalIncludingTax
.Select OK.
Select Transform > Group by from the transformations ribbon.
On the Group by settings page:
Change to Advanced.
Group by (if necessary, select Add grouping to add more group by columns):
Country
StateProvince
City
New column name (if necessary, select Add aggregation to add more aggregate columns and operations):
SumOfTaxAmount
- Choose Operation of Sum and Column of
TaxAmount
.
- Choose Operation of Sum and Column of
SumOfProfit
- Choose Operation of Sum and Column of
Profit
.
- Choose Operation of Sum and Column of
SumOfTotalIncludingTax
- Choose Operation of Sum and Column of
TotalIncludingTax
.
- Choose Operation of Sum and Column of
Select OK.
Right-click on Visual query 1 in the Explorer and select Rename.
Type
Sales Summary
to change the name of the query.Press Enter on the keyboard or select anywhere outside the tab to save the change.