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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SanderB
Frequent Visitor

Round values in measure

Hello all,

 

I use a measure for the calculation of the average in a pivot, if the value does not start with < (because a < will give error, no AVG) but everything is rounded on 2 decimals, and I want to show more decimals.

There is a decimals column, with all the decimal places per component.

I use:

 

Measure = 
VAR _text = SELECTEDVALUE( RESULT[Merged] )
VAR _search = SEARCH( "<", _text, 1, 0 ) > 0
RETURN IF( _search, _text,  AVERAGE( RESULT[VALUE] ) )

 

And the result is:

2019-11-15_13-49-00.jpg

This is what I want, if a result contains < or > it uses no calculation, just the first < or > value. If the results does not contain <  or > it calulates the average of 3 values. But every thing is rounded on 2 decimals.

 

This code does not have any influence:

 

Measure = 
VAR _text = SELECTEDVALUE( RESULT[Merged] )
VAR _search = SEARCH( "<", _text, 1, 0 ) > 0
RETURN IF( _search, _text,  ROUND(AVERAGE( RESULT[VALUE] ),5) )

 

and giving more decimal places in the pivot results in:

2019-11-15_13-54-37.jpg

Is there a way to influence the decimals in a measure like this?

 

Thanks in advance!

 

Best regards,

Sander

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hi @SanderB ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lid-msft ,

 

Very sorry for the late reply, I missed the reply 😞

 

You code looks very good, and in the example it does exactly what I want, but for some reason the FORMAT part mashed my table up.

The filters are not working anymore and no data is shown.

I will check my dataset and will let u know if it works.

 

Thank for the support!

 

Best regards,

Sander

 

v-lid-msft
Community Support
Community Support

Hi @SanderB ,

 

We can use the following formula to meet your requirement:

 

Measure =
VAR _text =
    SELECTEDVALUE ( RESULT[Merged] )
VAR _search =
    SEARCH ( "<", _text, 1, 0 ) > 0
RETURN
    IF (
        _search,
        _text,
        FORMAT ( ROUND ( AVERAGE ( RESULT[VALUE] ), 5 ), "0.00000" )
    )

 

7.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I don't know if I'm getting your problem fully but have you tried the simple way to go to the pane modelling and adjust the decimals there?

 

Best Regards,

Duarte Raminhos

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors