A sales manager I work with wanted two things on one Power BI page: a label that says Large order or Small order for each region, and a count of orders whose notes ask for a rush. Both answers are text, and both come from an IF measure.
The first formula most people type in Power BI, an IF that compares the Region column to “East”, fails inside a measure. A measure doesn’t look at one row; it looks at a whole filtered table, so the column needs SELECTEDVALUE, an aggregation or CONTAINSSTRING around it.
In this tutorial, I’ll write every Power BI IF statement with text I use for that kind of request: a measure that returns text, a text comparison with SELECTEDVALUE, an “if contains text then” test, the calculated column version and a nested IF for blanks. I tested each one in Power BI Desktop on 11/23/2026.
Quick answer: Return text from a measure with IF(condition, "Text if true", "Text if false"), for example IF([Total Import Amount] >= 1000, "Large order", "Small order"). To compare a column with text, wrap it in SELECTEDVALUE(). To check if a column contains text, use CONTAINSSTRING(column, "rush"), which ignores upper and lower case.
The Sample Data: 12 Imported Orders in Power BI
Every example uses one table in my Power BI demo report, Order Imports, loaded from SPGuides_Order_Imports_2026.csv with Home > Get data > Text/CSV. The CSV stored Amount as text, so I changed it to Decimal Number in Power Query first (N/A became null).
The same measures work whether your data comes from a CSV, an Excel workbook or a SharePoint list. If your amounts came in as text too, my post on how to convert text to number in Power BI walks through that step. Here are the columns my measures read:
| OrderID | Region | Customer | SalesRep | Amount | Notes |
|---|---|---|---|---|---|
| IMP-2001 | East | Harbor Point Dental | Rachel Morgan | $1,299.00 | Rush delivery requested |
| IMP-2002 | West | Cedar Ridge Realty | Tyler Brooks | $49.99 | |
| IMP-2003 | South | Lone Star Logistics | Brian Keller | $2,899.00 | Gift wrap |
| IMP-2004 | Central | Prairie Health Clinic | Marcus Hale | (blank) | Quote only – no amount yet |
| IMP-2005 | East | Bayside Credit Union | Dana Whitfield | $129.50 | |
| IMP-2006 | West | Summit Outdoor Gear | Tyler Brooks | $2,598.00 | RUSH – trade show |
| IMP-2007 | South | Magnolia Bakery Co | Brian Keller | $349.00 | |
| IMP-2008 | Central | Great Lakes Freight | Marcus Hale | (blank) | Customer will confirm amount |
| IMP-2009 | East | Harbor Point Dental | Rachel Morgan | $180.00 | |
| IMP-2010 | West | Pacific Coast Dental | Dana Whitfield | $1,449.50 | Rush order |
| IMP-2011 | South | Gulf Shore Marine | Brian Keller | $259.00 | |
| IMP-2012 | Central | Twin Rivers School District | Marcus Hale | $698.00 | Deliver after 06/30/2026 |
To add a measure in Power BI Desktop, select New measure in the Calculations group of the Home ribbon, type the formula in the formula bar and press Enter. The base measure for this post is a plain sum:
Total Import Amount = SUM('Order Imports'[Amount])
In a Table visual by Region it shows Central $698.00, East $1,608.50, South $3,507.00 and West $4,097.49, with a total of $9,910.99. Not sure whether you need a measure or a column? This calculated column vs measure comparison explains it.
Power BI IF Statement With Text Results in a Measure
Start with the simplest Power BI case: a numeric test that returns a word. Both results go in double quotes, and the third argument is the “else” text:
Order Size = IF([Total Import Amount] >= 1000, "Large order", "Small order")
Here’s the measure in the formula bar with the Table visual under it:

Central reads Small order because $698.00 is under 1,000. East, South, West and the Total row read Large order.
If you leave out the third argument, IF returns blank instead of text. If you know the IF function in Excel, the DAX version reads the same way; my Power BI IF statement tutorial covers the basics and numeric results.
Compare a Column to Text With SELECTEDVALUE
Now the request flips: the test itself is text. SELECTEDVALUE returns the region when the Power BI visual filters the row to one region, so it can sit on the left of the equals sign:
Region Check = IF(SELECTEDVALUE('Order Imports'[Region]) = "East", "East region", "Other region")

East shows East region and the other three show Other region. Look at the circled Total row: it says Other region too, because the total covers four regions, so SELECTEDVALUE returns blank and blank isn’t “East”.
If the total row should say something else, test HASONEVALUE first. SELECTEDVALUE is built on the same check, so this keeps the region rows as they are:
Region Check (All) =
IF(
NOT HASONEVALUE('Order Imports'[Region]),
"All regions",
IF(SELECTEDVALUE('Order Imports'[Region]) = "East", "East region", "Other region")
)
One more thing I confirmed: the DAX equals sign ignores case when it compares text. A calculated column testing [Region] = "east" matched all three East rows:
East Match (lowercase) = IF('Order Imports'[Region] = "east", "Matched", "No match")
The same SELECTEDVALUE trick drives slicer-based logic, as in FILTER with SELECTEDVALUE in Power BI.
Power BI IF Contains Text Then: CONTAINSSTRING in a Measure
For “if the notes contain rush, count it”, use CONTAINSSTRING as the filter inside CALCULATE. It returns TRUE when the second text appears anywhere in the first:
Rush Order Count = CALCULATE(COUNTROWS('Order Imports'), CONTAINSSTRING('Order Imports'[Notes], "rush"))

East shows 1, West 2 and the Total 3. Central and South are blank, because none of their notes mention a rush.
I typed “rush” in lowercase, yet it matched Rush delivery requested, RUSH – trade show and Rush order. CONTAINSSTRING is case-insensitive in Power BI and also accepts the ? and * wildcards. When case matters, swap in CONTAINSSTRINGEXACT, which takes the same two arguments.
The same CALCULATE pattern works for other yes/no counts in Power BI count if true measures.
DAX IF Column Contains Text: Calculated Column vs Measure
When you want a Rush or Standard label on every order, a Power BI calculated column is the natural fit, because it runs once per row. Select New column, then enter the formula; my tutorial on how to add a calculated column in Power BI shows those clicks:
Rush Column = IF(CONTAINSSTRING('Order Imports'[Notes], "rush"), "Rush", "Standard")
The measure version wraps Notes in SELECTEDVALUE, since a measure can’t read one row’s text directly:
Rush Flag = IF(CONTAINSSTRING(SELECTEDVALUE('Order Imports'[Notes]), "rush"), "Rush", "Standard")

Both return Rush on IMP-2001, IMP-2006 and IMP-2010, and Standard on the other nine orders. The column has no total. The Rush Flag measure shows Standard on the Total row, because twelve different notes give SELECTEDVALUE a blank.
My rule: column when you’ll filter, slice or group by the label; measure when it should react to slicers. A text label like this also feeds conditional formatting based on text nicely.
Nested IF in Power BI: Text Labels With a Blank Check
IMP-2004 and IMP-2008 have no amount yet. Put an ISBLANK test in front of the size test so those orders get their own label:
Order Size Label =
IF(
ISBLANK([Total Import Amount]),
"No amount yet",
IF([Total Import Amount] >= 1000, "Large order", "Small order")
)
By region it returns the same labels as Order Size, since every region has at least one amount. On a table by OrderID, the two blank orders are where the first branch kicks in, because Total Import Amount is blank on exactly those rows.
Past two or three outcomes, nested IFs in Power BI get hard to read. Switch to SWITCH with multiple conditions in Power BI, and for AND/OR tests see the Power BI IF with multiple conditions post.
Check If Text Contains a Value in Power Query
If the label never needs to react to slicers, you can build it in Power Query before the data reaches the Power BI model. In Power Query, choose Add Column > Custom Column and enter:
if Text.Contains([Notes], "rush", Comparer.OrdinalIgnoreCase) then "Rush" else "Standard"
Text.Contains is case-sensitive by default, so without Comparer.OrdinalIgnoreCase the RUSH – trade show order would come back Standard. It also doesn’t support wildcards, and it returns null when the text itself is null.
For the click-by-click version with a conditional column, see add a column if contains in Power Query. To pull part of the text out instead, read extract text in Power BI Power Query.
Power BI IF Text Errors and How to Fix Them
“A single value for column ‘Region’ in table ‘Order Imports’ cannot be determined.” This is the Power BI error from the intro. I added this measure on purpose to show it:
Region Test = IF('Order Imports'[Region] = "East", "East region", "Other region")

The bare column reference gets a red underline and the warning appears under the formula bar. Fix it with SELECTEDVALUE, as in Region Check, or make it a calculated column instead.
Empty text isn’t blank. The PromoCode column in my CSV has empty cells, and ISBLANK([PromoCode]) returned FALSE on every one of them. Test the length instead; more null and blank cases are in Power BI IF NULL then 0:
Promo Label = IF(LEN('Order Imports'[PromoCode]) = 0, "No promo", 'Order Imports'[PromoCode])
That returned No promo on the seven empty rows and kept WINTER10, SPRING15 and BACK2SCHOOL on the rest.
SEARCH errors when the text isn’t found. If you prefer SEARCH in Power BI, always pass the fourth argument (the value for “not found”), or the formula fails on rows without a match:
Rush (SEARCH) = IF(SEARCH("rush", 'Order Imports'[Notes], 1, 0) > 0, "Rush", "Standard")
Text and numbers in one IF. If one branch returns text and the other a number, IF returns a variant data type, which makes formatting and sorting awkward. Return text in both branches, or concatenate text and numbers with FORMAT. Browse more DAX patterns in the Power BI tutorials.
More Power BI posts that pair well with text measures:
Power BI IF Statement With Text: Common Questions
How do I write a Power BI IF statement with text?
Put the text results in double quotes: IF([Total Import Amount] >= 1000, “Large order”, “Small order”). If the test is text too, compare a value the measure can read, such as SELECTEDVALUE(‘Order Imports'[Region]) = “East”.
How do I check if a column contains text in DAX?
Use CONTAINSSTRING inside IF: IF(CONTAINSSTRING(‘Order Imports'[Notes], “rush”), “Rush”, “Standard”) in a calculated column. In a measure, wrap the column in SELECTEDVALUE or use CONTAINSSTRING as a CALCULATE filter.
Is CONTAINSSTRING case-sensitive in Power BI?
No. CONTAINSSTRING ignores upper and lower case, so “rush” matched Rush and RUSH in my test. Use CONTAINSSTRINGEXACT for a case-sensitive check. Both are described in the CONTAINSSTRING reference on Microsoft Learn.
Can a Power BI measure return text instead of a number?
Yes. A measure can return text from IF, SWITCH or SELECTEDVALUE, and Power BI shows it in tables, cards and matrix visuals. Keep both IF branches text so the measure doesn’t turn into a mixed type.
Why does my IF measure say a single value for a column cannot be determined?
The measure references a column directly, and a measure sees many rows at once. Wrap the column in SELECTEDVALUE, MAX or another aggregation, or move the logic into a calculated column.

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.