Skip to content

DP-600 · Domain 2: Prepare data · 46% of the exam

Task 2.3: Query and analyze data

Selecting, filtering and aggregating data with the visual query editor, with SQL in a lakehouse's SQL analytics endpoint or a warehouse, with KQL in an eventhouse, and with DAX against a semantic model.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.

Question 1 · choose 1

An analyst who knows T-SQL but not yet KQL works in a KQL queryset over an eventhouse. She wants to see how SELECT Region, COUNT(*) FROM Orders GROUP BY Region would be written in KQL, so that she can learn from it and reuse it. What should she run in the query editor?

  1. Aexplain followed by the SELECT statement, as the first line of the query
  2. BA line that holds only --, then explain followed by the SELECT statement
  3. CA line that holds only --, then the SELECT statement on its own
  4. DA line that holds only //, then explain followed by the SELECT statement
Show the answer and why
  • Aexplain followed by the SELECT statement, as the first line of the query

    Incorrect

    Without a T-SQL comment line first, the editor reads the text as KQL, not as a T-SQL statement to translate.

  • BA line that holds only --, then explain followed by the SELECT statement

    Correct

    An empty T-SQL comment line makes the editor read the query as T-SQL, and explain returns the equivalent KQL.

  • CA line that holds only --, then the SELECT statement on its own

    Incorrect

    That runs the T-SQL query and returns its results; explain is what returns the equivalent KQL.

  • DA line that holds only //, then explain followed by the SELECT statement

    Incorrect

    The editor interprets a query as T-SQL only when it begins with an empty T-SQL comment line, --, not //.

The KQL query editor supports T-SQL in addition to KQL, which is the recommended language. To run a T-SQL query, begin it with an empty T-SQL comment line, --, so that the editor interprets what follows as T-SQL. To get the equivalent KQL for a T-SQL SELECT statement instead of its results, add the keyword explain before the query, still after the -- line.

Question 2 · choose 1

A KQL query over the Devices table in an eventhouse must return all of the table's 40 columns except RawPayload and DebugInfo, without listing the 38 columns to keep. Which operator should the query use?

  1. Aproject-away RawPayload, DebugInfo
  2. Bproject RawPayload, DebugInfo
  3. Cextend RawPayload, DebugInfo
  4. Ddistinct RawPayload, DebugInfo
Show the answer and why
  • Aproject-away RawPayload, DebugInfo

    Correct

    project-away selects which columns of the input table to exclude from the output.

  • Bproject RawPayload, DebugInfo

    Incorrect

    project keeps only the columns it lists and drops all the others, the opposite of what's needed.

  • Cextend RawPayload, DebugInfo

    Incorrect

    extend creates calculated columns and appends them; it doesn't remove any column.

  • Ddistinct RawPayload, DebugInfo

    Incorrect

    distinct returns the distinct combinations of the listed columns, not every other column.

In KQL, project-away excludes the listed columns from the output and keeps the rest. project does the reverse: only the columns given as arguments are included, in that order, and the others are dropped. extend appends calculated columns, and distinct produces a table of the distinct combinations of the columns it's given.

Question 3 · choose 1

An analyst runs a SELECT in the warehouse's SQL query editor that returns 85,000 rows, but the results grid shows only part of them. She needs all 85,000 rows in a spreadsheet on her laptop for a one-off reconciliation, without creating any objects in the warehouse. What should she do?

  1. AUse Open in Excel, which runs the selected T-SQL query in Excel
  2. BCopy the whole results grid and paste it into an Excel workbook
  3. CUse Save as table and then download the table
  4. DUse Save as view and open the view in the visual query editor
Show the answer and why
  • AUse Open in Excel, which runs the selected T-SQL query in Excel

    Correct

    Open in Excel downloads a workbook that executes the query, so Excel gets the full result rather than the preview.

  • BCopy the whole results grid and paste it into an Excel workbook

    Incorrect

    The grid preview holds only the first 10,000 rows, so the copy would be incomplete.

  • CUse Save as table and then download the table

    Incorrect

    Save as table creates a table in the warehouse, which she must not do.

  • DUse Save as view and open the view in the visual query editor

    Incorrect

    That creates a view, and the editor's preview would still show only part of the rows.

In the SQL query editor, the Results preview shows only the first 10,000 rows when a query returns more. Highlighting a SELECT statement gives actions such as Save as view, Save as table (a CREATE TABLE AS SELECT into a warehouse), Open in Excel and Visualize results. Open in Excel opens the corresponding T-SQL query in Excel and executes it, so the results can be worked with locally.

Question 4 · choose 1

In the SQL query editor, an analyst selects and runs a statement that fills a #recent session temp table, then selects and runs a second SELECT that joins #recent to dbo.Customers. The second run fails because #recent doesn't exist. What should she do?

  1. ACreate #recent with a global ## name so later runs can see it
  2. BRun both statements together in one execution of the query window
  3. CWrap the first statement in BEGIN TRANSACTION so the session stays open
  4. DGrant herself CREATE TABLE permission on the dbo schema
Show the answer and why
  • ACreate #recent with a global ## name so later runs can see it

    Incorrect

    Temp tables in the warehouse are session-scoped; a separate run still gets a new session.

  • BRun both statements together in one execution of the query window

    Correct

    Each Run is an independent batch with its own session, so the temp table exists only within the batch that created it.

  • CWrap the first statement in BEGIN TRANSACTION so the session stays open

    Incorrect

    Transaction control across separate runs is limited, because every Run is its own batch and session.

  • DGrant herself CREATE TABLE permission on the dbo schema

    Incorrect

    Permissions aren't the issue; the temp table was created, but in a session that ended.

In the SQL query editor, every time you run a query, it opens a separate session and closes it at the end of the execution, so session context isn't kept between independent runs. Each Run submits an independent batch request, and a session exists only per batch, which also limits transaction control statements across runs. Running the statements together keeps them in one session, where a session-scoped #temp table is visible.

Question 5 · choose 1

A business analyst who doesn't write SQL builds a query in the visual query editor of a lakehouse's SQL analytics endpoint by merging two tables and filtering rows, and wants other analysts to query the result by name, always over the tables' current rows, without a copy of the data. One of her steps shows a banner that says the query is not supported as a warehouse view because it can't be fully translated to SQL. What should she do?

  1. AUse Save as view anyway, because the untranslated step runs at query time in Power Query
  2. BRemove or replace the step that can't be translated to SQL, then use Save as view
  3. CUse Save as table in the SQL analytics endpoint
  4. DSwitch the query to a DDL statement in the visual editor
Show the answer and why
  • AUse Save as view anyway, because the untranslated step runs at query time in Power Query

    Incorrect

    A view is a SQL object, so steps that can't be translated to SQL can't be part of it.

  • BRemove or replace the step that can't be translated to SQL, then use Save as view

    Correct

    Save as view needs the visual query to translate fully to SQL; steps that don't fold block it.

  • CUse Save as table in the SQL analytics endpoint

    Incorrect

    The endpoint is read-only, and Save as table writes a copy of the results into a warehouse table with CREATE TABLE AS SELECT, which goes stale.

  • DSwitch the query to a DDL statement in the visual editor

    Incorrect

    The visual query editor runs only read-only SELECT statements; DDL and DML aren't supported.

The visual query editor uses Power Query diagram view, but only a subset of Power Query operations that support query folding is supported, and some steps make the banner say the query isn't supported as a warehouse view because it can't be fully translated to SQL. Save as view creates a view from a query that translates to SQL, and Save as table loads results into a warehouse table with CREATE TABLE AS SELECT. The editor runs only read-only SELECT statements.

Question 6 · choose 1

An analyst with the Viewer role in the Sales workspace on an F64 capacity wants to run DAX queries against its semantic model from SQL Server Management Studio. The capacity's XMLA endpoint is read-only, and the tenant setting that allows XMLA endpoints is on. Her connection to powerbi://api.powerbi.com/v1.0/myorg/Sales succeeds, but she can't query the model. What does she need?

  1. AMembership in one of the semantic model's roles
  2. BThe tenant setting Users can work with semantic models in Excel using a live connection turned on
  3. CBuild permission on the semantic model
  4. DA Power BI Premium Per User license
Show the answer and why
  • AMembership in one of the semantic model's roles

    Incorrect

    Read access through the XMLA endpoint requires Build permission, whether or not the model has roles.

  • BThe tenant setting Users can work with semantic models in Excel using a live connection turned on

    Incorrect

    That setting governs Analyze in Excel; with Allow XMLA endpoints on, XMLA connections are allowed either way.

  • CBuild permission on the semantic model

    Correct

    Build permission is required for read access through the XMLA endpoint, regardless of semantic model roles.

  • DA Power BI Premium Per User license

    Incorrect

    PPU licenses matter for PPU workspaces; this model is on an F64 capacity.

A read-only XMLA endpoint allows client tools such as SSMS to query semantic model data and metadata. The tenant setting Allow XMLA endpoints and Analyze in Excel with on-premises semantic models must be on for XMLA connections; the setting for working with semantic models in Excel through a live connection only adds Analyze in Excel. Build permission on a semantic model is required for read access through the XMLA endpoint, regardless of the existence of model roles.

Question 7 · choose 2

Through the XMLA endpoint, you need DAX queries that return, first, the value of the [Total Sales] measure as a one-row result and, second, sales by month name sorted in calendar order. Month Name has a Sort by column set to Month Number in the model. Which two queries return what you need? (Choose TWO.)

  1. AEVALUATE { [Total Sales] }
  2. BEVALUATE [Total Sales]
  3. CEVALUATE SUMMARIZECOLUMNS('Date'[Month Name], "Sales", [Total Sales]) ORDER BY 'Date'[Month Name]
  4. DEVALUATE TOPN(12, SUMMARIZECOLUMNS('Date'[Month Name], "Sales", [Total Sales])) ORDER BY 'Date'[Month Name]
  5. EEVALUATE SUMMARIZECOLUMNS('Date'[Month Number], 'Date'[Month Name], "Sales", [Total Sales]) ORDER BY 'Date'[Month Number]
Show the answer and why
  • AEVALUATE { [Total Sales] }

    Correct

    Curly braces turn the scalar value into a one-row table, which EVALUATE can return.

  • BEVALUATE [Total Sales]

    Incorrect

    EVALUATE needs a table expression; a scalar has to be wrapped in a table constructor.

  • CEVALUATE SUMMARIZECOLUMNS('Date'[Month Name], "Sales", [Total Sales]) ORDER BY 'Date'[Month Name]

    Incorrect

    Sort by column doesn't apply to DAX query results, so this sorts alphabetically.

  • DEVALUATE TOPN(12, SUMMARIZECOLUMNS('Date'[Month Name], "Sales", [Total Sales])) ORDER BY 'Date'[Month Name]

    Incorrect

    TOPN doesn't use ORDER BY to pick rows, and Month Name still sorts alphabetically without its sort column.

  • EEVALUATE SUMMARIZECOLUMNS('Date'[Month Number], 'Date'[Month Name], "Sales", [Total Sales]) ORDER BY 'Date'[Month Number]

    Correct

    Including Month Number in the query lets ORDER BY sort in calendar order.

A DAX query requires EVALUATE followed by a table expression. A measure or other scalar expression can be returned as a table by enclosing it in curly braces, a table constructor such as EVALUATE {[Total Sales]}. The Sort by column property doesn't apply to DAX query results, so the sort column must be included in the query to be used in ORDER BY. TOPN has its own ordering; ORDER BY only sorts the result.

Question 8 · choose 1

In the visual query editor of a warehouse, a query's SQL ends with an ORDER BY clause, and Visualize results doesn't work for it. Why?

  1. AVisualize results works only in the SQL query editor
  2. BThe query must first be saved as a view
  3. CVisualize results currently doesn't support queries with an ORDER BY clause
  4. DORDER BY isn't valid T-SQL in Fabric Data Warehouse
Show the answer and why
  • AVisualize results works only in the SQL query editor

    Incorrect

    Visualize results is available from the visual query editor too.

  • BThe query must first be saved as a view

    Incorrect

    Saving as a view isn't required to visualize results.

  • CVisualize results currently doesn't support queries with an ORDER BY clause

    Correct

    This is a listed limitation of the visual query editor.

  • DORDER BY isn't valid T-SQL in Fabric Data Warehouse

    Incorrect

    ORDER BY is valid; only this feature doesn't support it.

The visual query editor provides a no-code way to build queries with Power Query diagram view. One of its listed limitations is that Visualize Results currently doesn't support SQL queries with an ORDER BY clause; ORDER BY itself is valid T-SQL.

Question 9 · choose 1

A user with the Viewer role in a workspace builds a useful visual query on its warehouse and wants to move it to the Shared queries folder for the team. The option isn't available to her. Why?

  1. AVisual queries can't be saved at all
  2. BShared queries is available only for SQL queries, not visual queries
  3. COnly the warehouse owner can use Shared queries
  4. DViewers and shared recipients can save queries only in My queries
Show the answer and why
  • AVisual queries can't be saved at all

    Incorrect

    Visual queries are saved automatically every few seconds.

  • BShared queries is available only for SQL queries, not visual queries

    Incorrect

    The restriction depends on the user's role, not the query type.

  • COnly the warehouse owner can use Shared queries

    Incorrect

    Contributors and above can move queries there, not only the owner.

  • DViewers and shared recipients can save queries only in My queries

    Correct

    Users in the Viewer role or shared recipients of the warehouse can't move queries to Shared queries.

As you build a visual query, it's saved automatically every few seconds, and all workspace users can save their queries in the My queries folder. Users in the Viewer role of the workspace or shared recipients of the warehouse are restricted from moving queries to the Shared queries folder.

Question 10 · choose 1

An app must send DAX queries to semantic models through the Power BI REST API's Execute Queries operation, and every call is refused. Which tenant setting must be enabled?

  1. AAllow XMLA endpoints and Analyze in Excel with on-premises semantic models
  2. BSemantic Model Execute Queries REST API
  3. CUsers can work with semantic models in Excel using a live connection
  4. DAllow DirectQuery connections to Power BI semantic models
Show the answer and why
  • AAllow XMLA endpoints and Analyze in Excel with on-premises semantic models

    Incorrect

    That setting covers XMLA and Analyze in Excel connections, not the REST Execute Queries operation.

  • BSemantic Model Execute Queries REST API

    Correct

    This setting lets users in the organization query semantic models with DAX through the Power BI REST APIs.

  • CUsers can work with semantic models in Excel using a live connection

    Incorrect

    That setting covers exporting to Excel with a live connection.

  • DAllow DirectQuery connections to Power BI semantic models

    Incorrect

    That setting controls DirectQuery to semantic models in composite models.

The admin portal's integration settings include Semantic Model Execute Queries REST API, which lets users in the organization query semantic models by using DAX through the Power BI REST APIs. XMLA endpoint connections and Analyze in Excel are governed by other settings.

Practice domain 2 →Practice all domains →