Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

2.4 Adding Conditional Columns

Lesson 14 of 62 in the free Power BI notes on Siksha Sarovar, written by Rohit Jangra.

Adding Conditional Columns

Conditional columns allow you to create new columns based on logical conditions — similar to IF statements in Excel.

What is a Conditional Column?

A column whose values are determined by rules/conditions applied to existing data. It's a powerful way to categorize, label, or transform data without writing code.

Creating a Conditional Column

Steps:

  1. Go to Add Column tab in Power Query
  2. Click Conditional Column
  3. In the dialog box:
  • New column name: Enter the name for your new column
  • Column Name: Select the column to evaluate
  • Operator: Choose a comparison operator (equals, greater than, contains, etc.)
  • Value: Enter the value to compare against
  • Output: Enter the result if the condition is true
  1. Add more conditions using Add Clause
  2. Set the Otherwise value (default if no conditions match)
  3. Click OK

Example: Categorizing Sales

ConditionOutput
If Sales > 10000"High"
If Sales > 5000"Medium"
Otherwise"Low"

Available Operators

OperatorDescription
equalsExact match
does not equalNot equal to
is greater thanGreater than
is greater than or equal toGreater than or equal
is less thanLess than
is less than or equal toLess than or equal
begins withText starts with specified characters
ends withText ends with specified characters
containsText contains specified characters
does not containText does not contain specified characters

Custom Columns (M Formula)

For more complex logic, use Add ColumnCustom Column and write an M expression.

Example M Expression:

if [Sales] > 10000 then "High"
else if [Sales] > 5000 then "Medium"
else "Low"

Conditional Column vs DAX Calculated Column

FeatureConditional Column (Power Query)Calculated Column (DAX)
Created InPower Query EditorData Model
LanguageM languageDAX
When EvaluatedDuring data load/refreshAfter data is loaded
PerformanceGenerally faster (pre-computed)Computed in memory
Best ForSimple categorization, data prepComplex relationships, row context