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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mahamood0218
Helper II
Helper II

Remove zero's from column

Hello PBI Experts ,

i have a requirement to remove leading 0 zero from table by using dax fucntion 

Mahamood0218_0-1659097621063.png

Output :

Mahamood0218_1-1659097661414.png

must be deine dax fuction could you please suggest this issue.

 

Thanks&Regards,

shaik

2 ACCEPTED SOLUTIONS
ImkeF
Community Champion
Community Champion

Hi @Mahamood0218 ,
you can add a column with this formula: 
Text.Trim([Values], "0")

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

Jos_Woolley
Solution Sage
Solution Sage

Since you asked for a solution in DAX, this Calculated Column:

 

New Column =
VAR MyValue = 'Table'[Values]
VAR T1 =
    ADDCOLUMNS(
        GENERATE(
            VALUES( 'Table'[Values] ),
            GENERATESERIES( 1, LEN( 'Table'[Values] ), 1 )
        ),
        "MyChar", MID( 'Table'[Values], [Value], 1 )
    )
RETURN
    MID(
        'Table'[Values],
        MINX(
            FILTER( T1, 'Table'[Values] = MyValue ),
            IF( [MyChar] <> "0", [Value] )
        ),
        LEN( 'Table'[Values] )
    )

 

Regards

View solution in original post

4 REPLIES 4
Jos_Woolley
Solution Sage
Solution Sage

Since you asked for a solution in DAX, this Calculated Column:

 

New Column =
VAR MyValue = 'Table'[Values]
VAR T1 =
    ADDCOLUMNS(
        GENERATE(
            VALUES( 'Table'[Values] ),
            GENERATESERIES( 1, LEN( 'Table'[Values] ), 1 )
        ),
        "MyChar", MID( 'Table'[Values], [Value], 1 )
    )
RETURN
    MID(
        'Table'[Values],
        MINX(
            FILTER( T1, 'Table'[Values] = MyValue ),
            IF( [MyChar] <> "0", [Value] )
        ),
        LEN( 'Table'[Values] )
    )

 

Regards

@Jos_Woolley now dax fuction is working thanks for help.

Mahamood0218_0-1659331748863.png

 

ImkeF
Community Champion
Community Champion

Hi @Mahamood0218 ,
you can add a column with this formula: 
Text.Trim([Values], "0")

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

@ImkeF i have try your formula this is also working ,thanks for help.

Mahamood0218_1-1659331848529.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Kudoed Authors