DAX Concept

Implementing Conditional Logic with IF and SWITCH for Calculated Columns in Power BI

Create calculated columns in Power BI with DAX conditional logic, then verify the result in report visuals.

BeginnerIFSWITCHISBLANK

Concept Breakdown

Conditional logic lets a Power BI model translate raw fields into business-friendly categories. IF is useful for simple yes/no decisions. SWITCH(TRUE()) is easier to scan when several ordered conditions must be tested. ISBLANK helps you handle missing values explicitly, which keeps tables, labels, and visuals easier for users to interpret.

What You Will Learn

  1. Use IF to turn a binary condition into a readable category.

  2. Use SWITCH(TRUE()) to assign rows into size bands.

  3. Use ISBLANK to handle missing location values without breaking report labels.

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 the starter PBIX file and open it in Power BI Desktop.

  2. Switch to the table view for the Building table.

  3. Create a calculated column named Has basement that returns No when Floors below ground equals 0 and Yes otherwise.

  4. Create a calculated column named Century that returns 20th Century when Opened is before 2001 and 21st Century otherwise.

  5. Create a calculated column named Size using SWITCH(TRUE()) to group buildings into Tiny, Small, Medium, Big, and Massive bands based on height.

  6. Create a calculated column named Location that returns Unknown location when Coordinates is blank and otherwise returns Coordinates.

  7. Refresh the visuals and compare them with the expected result.

  8. Enter the numeric verification answer from the finished report.

Starter DAX

New Column =
// Your DAX expression here

Expected Outcome

The completed report includes calculated columns for basement status, century, building size band, and location fallback. Visuals summarize the new categories correctly.

Checking your sign-in status...