Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-pro· GoogleHugging Face LMArena Human Preference 140K

After cleaning Salary column, now only it shows figures with values and 0, however now…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-opus-4-20250514’s answer.
  1. User

    After cleaning Salary column, now only it shows figures with values and 0, however now help me find if the figures are number or text?

  2. Gemini Assistant

    Excellent question! It's a critical step in data cleaning to confirm that numbers are actually stored as numbers and not as text that looks like a number. If they are text, calculations like > 40000 will not work as expected.

    Here are three simple and definitive ways to check the data type of your "Salary" column in Power Query, from the easiest to the most thorough.


    Method 1: Check the Column Header Icon and Alignment (The Quickest Way)

    This is the fastest visual check. Look at the "Salary" column in the Power Query editor.

    1. Check the Icon: In the column header, to the left of the name "Salary", there is a small icon that tells you the data type.

      • 123 means Whole Number.
      • 1.2 means Decimal Number.
      • ABC means Text.
    2. Check the Alignment: By default, Power Query aligns data in the preview pane based on its type.

      • Numbers are right-aligned.
      • Text is left-aligned.

    Here's a visual comparison:

    Notice the "123" icon and the right-alignment. This is a Number column.
    Notice the "ABC" icon and the left-alignment. This is a Text column.

    Conclusion: If you see the "ABC" icon and your numbers are left-aligned, the column is definitely text.


    Method 2: Use the Filter Menu (Very Reliable)

    The options available in the filter dropdown menu change depending on the column's data type.

    1. Click the filter dropdown arrow in the "Salary" column header.
    2. Look at the options at the top of the menu.
    • If the column is a Number, you will see "Number Filters".

    • If the column is Text, you will see "Text Filters".

    Conclusion: If you see "Text Filters", Power Query is treating your column as text, even if it only contains digits.


    Method 3: Create a Custom Column to Reveal the Type (The Definitive Proof)

    This method is foolproof and will tell you the exact data type for every single cell, which is useful if you suspect mixed types within the column.

    1. Go to the Add Column tab.
    2. Click on Custom Column.
    3. In the dialog box:
      • New column name: DataTypeCheck (or any name you like).
      • Custom column formula: = Value.Type([Salary])
    4. Click OK.

    A new column will be created. Click on any cell in this new DataTypeCheck column and look at the preview pane at the bottom of the Power Query window.

    • It will show type number if the cell contains a number.
    • It will show type text if the cell contains text.

    What to Do if it's Text? (The Solution)

    If any of the methods above confirm that your "Salary" column is text, here is how you fix it:

    1. Select the Salary column.
    2. Go to the Transform tab.
    3. In the "Any Column" group, click on Data Type.
    4. Select Whole Number or Decimal Number.

    After you change the data type to a number format, the column icon will change to 123, the data will become right-aligned, and your original custom column formula for "Seniority" (if [Salary] > 40000 then "Senior" else "Junior") will work perfectly.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.