Forum Discussion

kdeepak300's avatar
kdeepak300
Regular Visitor
1 year ago

Using ties slicer when I concatenate two columns alignment is not matching

Hi, Am using ties slicer am having the Requirement where I need to concatenate two columns. One is string data and one more is numeric data. when i concatenate two columns, the number column is not aligned properly. Below is the Screenshot. I'm using a DAX query to concatenate these two columns but still the second column is not aligned properly. Please give some input.

 

 

2 Replies

  • How are you attempting to do the alignment?

    Are you padding the data with spaces? If so you would need to use a fixed width font like Consolas or Courier New

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you d_gosbell 

    Hi, kdeepak300 

    Because your text columns are of different lengths and are case-lowercase, the numbers don't align.
    I've tried aligning the text columns with the len function and the rept function, but I didn't have any luck.

    As you can see, the country field is of unequal length, and some are case-sensitive, which will occupy some positions.

    This calculates the difference in the number of characters between the current national character length and the maximum national character length

    Although I tried to align the longest string by filling in the difference of each line with a rept, it failed to align due to case issues.

    Of course, we can think about it the other way around, whether to make it all uppercase and then align it:

    This is still problematic because the space occupied by each letter is not the same. If you are interested in learning more about him, you can download this sample PBIX file below.

     

     

    Best Regards

    Jianpeng Li

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