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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.