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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Oguzhan0556
Helper I
Helper I

How do we align only the cells we want in a column?

Hello,

I am new here. I'm asking my first question so I'm a little excited 😊

My table has a column named "Source".

Oguzhan0556_0-1669898996325.png

I want to center-align the "Swat" and "Other" cells in this column because these two values ​​are sub-breakdowns of the "Protocol Number".

Oguzhan0556_1-1669899021258.png

For this, I wrote a formula like this in Power query.

if

[Source] = "Swat" or

[Source] = "Diger"

then Text.PadStart([Source], 20)

else [Source]

 

Honestly, Column was what I wanted, but after I said close&apply, I realized that there was no change in power bi. Then I tried DAX

 

Example = IF(VALUES(Protocol[Source]) = "Swat", "                     Swat", 0)

 

but still no result... How do you think I can solve this problem? Thank you.

 

 

1 ACCEPTED SOLUTION

Hi, @v-zhangti 

 

I found what caused the problem. If we disable the "Word Wrap" button in the Values ​​section, the problem disappears.

 

Oguzhan0556_0-1669985258462.png

 

So in the first method I tried, it actually happened, but it didn't happen because "Word wrap" was active.         Example = IF(VALUES(Protocol[Source]) = "Swat", " Swat", 0)

 

thanks for everything 🙂

 

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @Oguzhan0556 

 

You can try the following methods.

Column = IF(OR([Source]="Swat",[Source]="Diger"),"      "&[Source],[Source])

vzhangti_0-1669963902250.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-zhangti 

 

I do what you did, but it doesn't work for me. By the way, if I don't use VALUES(), it doesn't recognize that column. How does he know you? The formula I wrote is as follows;

 

columnn = IF(OR(VALUES(Protocol[source]) = "Swat", VALUES(Protocol[source]) = "Diger"), " "& VALUES(Protocol[source]), VALUES(Protocol[source]))
 
By the way, I actually have a table called protocol. source is a column of the protocol table.
 

Thank you.

Hi, @Oguzhan0556 

 

Please check the attachment to see if our source data is different.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, @v-zhangti 

 

I found what caused the problem. If we disable the "Word Wrap" button in the Values ​​section, the problem disappears.

 

Oguzhan0556_0-1669985258462.png

 

So in the first method I tried, it actually happened, but it didn't happen because "Word wrap" was active.         Example = IF(VALUES(Protocol[Source]) = "Swat", " Swat", 0)

 

thanks for everything 🙂

 

Hi,

 

I ran your report and it looks like the following. So the alignment hasn't changed. Does it look changed to you? Isn't that very interesting?

 

Thank you...

 

Oguzhan0556_0-1669972356623.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.