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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.