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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BIswajit_Das
Resolver III
Resolver III

DAX Ideas

Hello Experts,

There's a column with value "apple","ball".

But i want to return the calculated column with values like : "apple    ", "ball   "

Thanks & Regards....

2 ACCEPTED SOLUTIONS
bchager6
Super User
Super User

@BIswajit_Das  If I understand correctly, just use CONCATENATE and put as many spaces you need in the second text argument:

bchager6_0-1712580025404.png

 

 

 

View solution in original post

BIswajit_Das
Resolver III
Resolver III

Finally found a way :

In order to append extra spaces according to our requirement

we can use the following DAX mentioned below

i.e

RESPONSE_C =
VAR currentValue = 'table'[column]
VAR currentLength =
    LEN ( CONVERT ( currentValue, STRING ) )
VAR extraSpaces = 10 - currentLength // change 10 according to our requirement.
VAR prefix =
    REPT ( UNICHAR ( 0160 ), extraSpaces )
RETURN
    "" & prefix & ""
        & currentValue

View solution in original post

5 REPLIES 5
BIswajit_Das
Resolver III
Resolver III

Finally found a way :

In order to append extra spaces according to our requirement

we can use the following DAX mentioned below

i.e

RESPONSE_C =
VAR currentValue = 'table'[column]
VAR currentLength =
    LEN ( CONVERT ( currentValue, STRING ) )
VAR extraSpaces = 10 - currentLength // change 10 according to our requirement.
VAR prefix =
    REPT ( UNICHAR ( 0160 ), extraSpaces )
RETURN
    "" & prefix & ""
        & currentValue
bchager6
Super User
Super User

@BIswajit_Das  If I understand correctly, just use CONCATENATE and put as many spaces you need in the second text argument:

bchager6_0-1712580025404.png

 

 

 

I've got it it's in the matrix column header setting

We've have to disable Text wrap and enable Auto-size width

in-order to acheive my requirement.

Thanks you...

@bchager6  Thanks for responding but it's not working

If you check it using a matrix you'll see that the spaces are ignored.

HotChilli
Super User
Super User

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.