cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amanuit
Regular Visitor

Power query editor-Add column

Hello,

I am very new to power BI.

I am trying to add a conditional column and in condition, I want to compare a column with "."  or any text but i am getting error and it is asking to provide number number.

Does it compare only numbers?

or the column which i have selected is number then i how can i convert it into text, another question if i convert it into text then will it impact on dashboard?

3 REPLIES 3
KNP
Super User
Super User

An alternative approach for comparing number and text types would be to add Text.From() to the number column.

e.g.

KNP_0-1659379659825.png

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
amanuit
Regular Visitor

Thank you for reply

jennratten
Super User
Super User

Hello - the columns you are comparing need to be of the same data type.  If you change the actual type of the column it could have subsequent negative consequences.  For example, if you convert a number to text and you are later summing that number, the sum function will fail because it is text.  If you need to compare a number to text, you can add a column that compares the text value of another column to the comparison text.  That way your original value is not impacted.

Helpful resources

Announcements
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.