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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
krishnaHCL
Regular Visitor

How to Roundup a value to its nearest highst 10th postion value

Hi All,

I need a DAX expression for below condition. Please help me on this ASAP. Thanks in advance.

1.if max value is 19 ,
then highestvalue in Y axis = 20
2.if max value is 123.4,
then highestvalue in Y axis = 130
3.if max value is 190 ,
then highestvalue in Y axis = 190
4.if max value is 135,
then highestvalue in Y axis = 140

2 ACCEPTED SOLUTIONS

Thanks for the response @v-yadongf-msft .

 

I have got my solution actully. Below is the query to get my desired output.

NewColumn = Roundup('ColumnName',-1)

this will give the below output

Base Column    New Column

3                                10

4.5                             10

17                              20

56                              60

47                              50

99                            100

127                          130

199                          200

View solution in original post

Hi @v-yadongf-msft Thanks for your response.

 

I have got solution for my issue. Below is the query for it

ResultColumn = ROUNDUP('ColumnName',-1)

this will give below result

ColumnName       ResultColumn

4                                   10

17                                 20

89                                 90

144                             150

237                             240

 

Same way If want to get the nearest min 10th position value you need to use the query below

ResultColumn = ROUNDDOWN('ColumnName',-1)

This will give below output

ResultColumn       ColumnName

5                                  0

13                               10

67                               60

99                               90

157                           150

 

hope this will help anyone in future thats why posting here.

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @krishnaHCL ,

 

This is my test table:

vyadongfmsft_0-1670376483978.png

 

 

Create a new column:

NewValue = SWITCH(
    TRUE(),
    MAXX(FILTER('Table','Table'[Value] = EARLIER('Table'[Value])),'Table'[Value]) = 19, 20,
    MAXX(FILTER('Table','Table'[Value] = EARLIER('Table'[Value])),'Table'[Value]) = 123.4, 130,
    MAXX(FILTER('Table','Table'[Value] = EARLIER('Table'[Value])),'Table'[Value]) = 190, 190,
    MAXX(FILTER('Table','Table'[Value] = EARLIER('Table'[Value])),'Table'[Value]) = 135, 140,
    'Table'[Value]
)

 

I think you will get the result you want:

vyadongfmsft_1-1670376537913.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yadongf-msft Thanks for your response.

 

I have got solution for my issue. Below is the query for it

ResultColumn = ROUNDUP('ColumnName',-1)

this will give below result

ColumnName       ResultColumn

4                                   10

17                                 20

89                                 90

144                             150

237                             240

 

Same way If want to get the nearest min 10th position value you need to use the query below

ResultColumn = ROUNDDOWN('ColumnName',-1)

This will give below output

ResultColumn       ColumnName

5                                  0

13                               10

67                               60

99                               90

157                           150

 

hope this will help anyone in future thats why posting here.

Thanks for the response @v-yadongf-msft .

 

I have got my solution actully. Below is the query to get my desired output.

NewColumn = Roundup('ColumnName',-1)

this will give the below output

Base Column    New Column

3                                10

4.5                             10

17                              20

56                              60

47                              50

99                            100

127                          130

199                          200

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.