Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Convert numbers into text

Hi, I have a column with 4 different numbers, lets call them 1111, 2222, 3333, 4444. For a diagram, I want them to be named, e.g. for 1111, should be named AAAA, 2222 should be named BBBB etc.

 

What is the best way to do it? Is it with a convert()? Couldn't figure it out yet.

 

Thanks for any help!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

What is the logic to give the names ?

If you have it mapped in another table, you can just merge both tables and use this column.



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

7 REPLIES 7
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

This is an Power Query solution using custom column:

 

let
_char = {"A".."Z"},
_value = Number.FromText(Text.Start(Number.ToText([Column1]), 1)) - 1
in Text.Repeat(_char{_value}, Text.Length(Text.From([Column1])))

 

Capture.PNG

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Hi @camargos88 ,

 

thanks for that solution. It unfirtunatley also didn't worked out. Power Bi shows "error" in every row of the column.

As far as I understand your formula, I would say it is maybe not the right approach. But I'm not sure.

 

To make it more clear:

I have a column with four different numbers, that are in there.

 

like

 

Column1

1111

1111

3333

2222

1111

4444

2222

 

and I want to give every specific number of that four numbers, the right name.

 

Like for example: 1111 is Steven, 2222 is Christoph, 3333 is Larry, 4444 is Magdalen

 

So it should look like this:

 

Column1          Column2

1111                  Steven

1111                  Steven

3333                   Larry

2222                  Christoph

 

etc.

 

 

Hi @Anonymous ,

 

What is the logic to give the names ?

If you have it mapped in another table, you can just merge both tables and use this column.



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Thank you. Since I had just 4 names to merge with the numbers it was easy to make a seperate table and merge it with the other one.

I made it more complicated than needed.

Thanks for the solution @camargos88 worked out perfect!

harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

 

Create a Calculated Column.


Column = 
SWITCH(
TRUE(),
'Table'[Column] = 1111 , "AAAA",

'Table'[Column] = 2222 , "BBBB",

'Table'[Column] = 3333 , "CCCC",

'Table'[Column] = 4444 , "DDDD"

)

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hi @harshnathani,

 

thanks for that solution. It unfortunatley didn't worked out. Power Bi shows me the following message:

 

DAX comparisons do not support comparisons between text and integer values. You can use the VALUE function or the FORMAT function to convert one of the values.

But I think this is in general the right way to do it!

 

 

HI @Anonymous ,

 

 

What is the Data Type of 1111 ?? Is it Text or Integer.

 

Pls check and let me know.

 

Can you share a screen shot if your table.

 

Regards,

Harsh Nathani

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors