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
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
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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.