DAX Concept

DAX Query: Identifying Brexit 'Remain' Stronghold Areas by Vote Ratio

Learn to write a DAX query using EVALUATE to filter and order data based on a calculated ratio between 'Remain' and 'Leave' votes.

BeginnerEVALUATEFILTERORDER BY

Concept Breakdown

DAX queries, executed in tools like DAX Studio, allow you to retrieve and manipulate data directly from your Power BI data model. The `EVALUATE` statement is fundamental for running queries, returning a table expression. The `FILTER` function lets you specify conditions to include or exclude rows, while `ORDER BY` sorts the results based on one or more columns in ascending or descending order. This exercise combines these to find specific data patterns.

What You Will Learn

  1. Understand when to use EVALUATE, FILTER, ORDER BY in a Power BI model.

  2. Practice the concept inside a real PBIX report rather than only reading syntax.

  3. Complete a beginner-level task and verify the result with a hidden answer check.

Practice in Power BI

The starter PBIX link has not been attached yet. The student workflow is ready for the admin to connect the file.

  1. Download and unzip the provided Power BI file.

  2. Open the Power BI Desktop file and connect to it using DAX Studio.

  3. In DAX Studio, write a DAX query using `EVALUATE` that lists out all areas where the 'Remain' vote was more than three times the 'Leave' vote.

  4. Order the results in descending order by the 'Remain' votes.

  5. Save your query as `Remain strongholds.dax`.

Starter DAX

EVALUATE
CALCULATETABLE(
    'YourTableName'
)

Expected Outcome

A table showing voting areas where 'Remain' votes significantly outnumbered 'Leave' votes (more than 3 times), sorted with the highest 'Remain' vote areas at the top.

Checking your sign-in status...