Great question! Here are several ways to check if your Salary column contains numbers or text in Power Query:
Method 1: Check the Data Type Icon (Quickest)
Look at the column header in Power Query:
- 123 icon = Number (Whole Number)
- 1.2 icon = Decimal Number
- ABC icon = Text
- [?] icon = Any (mixed or undetected type)
Method 2: Check Data Type in the Formula Bar
- Click on the Salary column header
- Look at the formula bar at the top
- You'll see something like:
= Table.TransformColumnTypes(#"Previous Step",{{"Salary", type text}}) → It's TEXT
= Table.TransformColumnTypes(#"Previous Step",{{"Salary", type number}}) → It's NUMBER
Method 3: Use a Test Column
Create a custom column to test the data type:
- Add Column → Custom Column
- Name:
DataTypeCheck
- Formula:
Value.Type([Salary])
This will show:
Number for numeric values
Text for text values
Method 4: Try a Mathematical Operation
Create a test column:
- Add Column → Custom Column
- Name:
Test
- Formula:
[Salary] * 1
- If it works without errors → Numbers
- If you get errors → Text
Method 5: Check with Type Detection
Create another test column:
- Add Column → Custom Column
- Name:
IsNumber
- Formula:
Value.Is([Salary], type number)
This returns:
TRUE if it's a number
FALSE if it's text
Method 6: Visual Inspection
In Power Query:
- Numbers are typically right-aligned
- Text is typically left-aligned
How to Convert if It's Text:
If you discover the Salary column is text, convert it:
- Select the Salary column
- Transform tab → Data Type → Whole Number or Decimal Number
OR use this in a custom column:
Number.From([Salary])
Quick Test Formula
To quickly verify and use in your Seniority column, try this formula:
if Number.From([Salary]) > 40000 then "Senior" else "Junior"
If this formula works without errors, your data is being properly converted to numbers for the comparison.
Which method revealed your data type? Let me know what you found!