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
ArchStanton
Power Participant
Power Participant

Cannot remove decimal places

Hi,

 

This is driving me mad, hope someone can help!

The code below defaults the Average Months to 2 decimal places - I don't want any decimals.

 

Case Length (Adj) Mths = 
IF (
    'Cases'[statecode] = "Active",
    DATEDIFF (
        IF (
            ISBLANK ( 'Cases'[legacycasecreationdate] ),
            'Cases'[Created On],
            'Cases'[legacycasecreationdate]
        ),
        NOW (),
        MONTH
    ),
    DATEDIFF (
        IF (
            ISBLANK ( 'Cases'[legacycasecreationdate] ),
            'Cases'[Created On],
            'Cases'[legacycasecreationdate]
        ),
        'Cases'[Resolution Date],
        MONTH
    )
)

 

ArchStanton_0-1707481170559.png

 

I have tried so many solutions and none work.

1 ACCEPTED SOLUTION

@ArchStanton 

Measure = FORMAT(SUM(Table[Case Length (Adj) Mths]),"##")






Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

10 REPLIES 10
Daniel29195
Community Champion
Community Champion

@ArchStanton 

use format (  your_measure_code , "##")

 

let me know if this works .

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Hi,

 

Using FORMAT breaks the code and my Average average disappears: 

 

ArchStanton_1-1707482351744.png

 

ArchStanton_0-1707482274295.png

 

Case Length (Adj) Mths = FORMAT(
IF (
    'Cases'[statecode] = "Active",
    DATEDIFF (
        IF (
            ISBLANK ( 'Cases'[legacycasecreationdate] ),
            'Cases'[Created On],
            'Cases'[legacycasecreationdate]
        ),
        NOW (),
        MONTH
    ),
    DATEDIFF (
        IF (
            ISBLANK ( 'Cases'[legacycasecreationdate] ),
            'Cases'[Created On],
            'Cases'[legacycasecreationdate]
        ),
        'Cases'[Resolution Date],
        MONTH
    )
),"##")

 

 

 

 

PijushRoy
Community Champion
Community Champion

Hi @ArchStanton 

Please use a measure 

 

Measure = FORMAT([YourMeasure],"##")


Let me know if that works for you

 


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





@ArchStanton 

 

convert(format( your_measure, "##" ) ,integer) 

 

 

pattern : 

Daniel29195_0-1707483435512.png

 

Thanks Daniel, I managed to get the answer from the other helper on this thread, I was dealing with a calculated column not a Measure.

Thank you for helping anyway.

Hi, I've responded to Daniel above who proposed the same solution. It does not work as I am summarising the calaculated column by 'Averaging'.

 

FORMAT breaks the code and I do not have the option to see a Summarised value anymore only Counts

Hi @ArchStanton 

Dont change your existing measure
Create a another measure use 

Measure = FORMAT([Case Length (Adj) Mths],"##")

 

If your requirement is solved, please mark THIS ANSWER as SOLUTION

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Case Length (Adj) Mths is a calculated column not a measure

 

It was initially calculating DAYS but I created a copy and changed the Parameter to MONTH earlier today

@ArchStanton 

Measure = FORMAT(SUM(Table[Case Length (Adj) Mths]),"##")






Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hi,

Thanks for helping me with this.

It didn't work initially because the Calculated Column is summarised as an Average.

I removed this from the column, substituted SUM for AVERASGE and it now works with no decimal places 😊

It's incredible that so much effort and resource is required to do a simple thing like this - maybe its something for the ideas board?!

 

Thanks for your help!

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 Fabric 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.