{"id":1645,"date":"2023-01-21T03:02:59","date_gmt":"2023-01-21T03:02:59","guid":{"rendered":"https:\/\/monocroft.com\/?p=1645"},"modified":"2023-03-16T04:39:38","modified_gmt":"2023-03-16T04:39:38","slug":"how-to-do-custom-rounding-in-dax","status":"publish","type":"post","link":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/","title":{"rendered":"How to Do Custom Rounding in DAX"},"content":{"rendered":"\n

In Power BI, DAX provides a ROUND function that can be used to round off numbers to a certain number of decimal places. However, if you want to do custom rounding, you will need to use a combination of other DAX functions.<\/p>\n\n\n\n

You can do custom rounding in DAX by using the FLOOR<\/strong> and CEILING<\/strong> functions. The CEILING function rounds a number up<\/strong> to the nearest integer or the nearest multiple of significance.<\/p>\n\n\n\n

While the FLOOR function rounds a number down<\/strong>, toward zero, or to the nearest multiple of significance.<\/p>\n\n\n\n

In this article, I will explain how to use both the floor and ceiling functions to do custom rounding in DAX.<\/p>\n\n\n\n

Let’s get started.<\/p>\n\n\n\n

Understand How Custom Rounding Works in DAX<\/h2>\n\n\n\n

When writing DAX formulas, rounding is decided by a user-defined precision parameter. This parameter specifies the number of significant digits that will be returned and is adjusted based on the original value in the data expression. <\/p>\n\n\n\n

Hence, understanding this will help you tailor your custom rounding to get the exact results you want. With this knowledge, let’s explore different functions to do custom rounding in Power BI.<\/p>\n\n\n\n

1. The FLOOR function<\/h2>\n\n\n\n

To use the FLOOR <\/code><\/strong>function, you can write a formula like this:<\/p>\n\n\n\n

= FLOOR(number, significance)<\/code><\/strong><\/pre>\n\n\n\n

Where number<\/strong> is the decimal number you want to round down, and significance<\/strong> is the multiple to which you want to round down.<\/p>\n\n\n\n

For example, if you want to round the number 3.5 down<\/strong> to the nearest whole number, you would use the formula:<\/p>\n\n\n\n

= FLOOR(3.5, 1)<\/code><\/strong><\/pre>\n\n\n\n

This would return the value “3<\/strong>“<\/p>\n\n\n\n

2. The CEILING function<\/h2>\n\n\n\n

To round up a number using the CEILING <\/strong><\/code>function, you can write a formula like this:<\/p>\n\n\n\n

= CEILING(number, significance)<\/strong><\/code><\/pre>\n\n\n\n

Where number<\/strong> is the decimal number you want to round up, and significance<\/strong> is the multiple to which you want to round up.<\/p>\n\n\n\n

For example, to round the number 3.5 up<\/strong> to the nearest whole number, your formula would be:<\/p>\n\n\n\n

= CEILING(3.5, 1)<\/strong><\/code><\/pre>\n\n\n\n

This would return the value “4”<\/strong><\/p>\n\n\n\n

3. The ROUND and ROUNDUP functions<\/h2>\n\n\n\n

Alternatively, DAX provides the ROUND <\/code><\/strong>and ROUNDUP<\/strong> <\/code>functions for rounding numbers into a specified number of decimal places. Here is how to use both:<\/p>\n\n\n\n

The ROUND function<\/h3>\n\n\n\n

To use the ROUND <\/code><\/strong>function, you can use the formula:<\/p>\n\n\n\n

= ROUND(number, decimal_places)<\/strong><\/code><\/pre>\n\n\n\n

Where number<\/strong> is the number you want to round, and decimal_places<\/strong> is the number of decimal places to which you want to round.<\/p>\n\n\n\n

For example, if you want to round the number 4.56789 to two decimal places<\/strong>, you would use the formula:<\/p>\n\n\n\n

= ROUND(4.56789, 2)<\/strong><\/code><\/pre>\n\n\n\n

This would return the value “4.57”<\/strong><\/p>\n\n\n\n

The ROUNDUP function<\/h3>\n\n\n\n

To use the ROUNDUP<\/strong> <\/code>function, you can write a formula like this:<\/p>\n\n\n\n

= ROUNDUP(number, decimal_places)<\/strong><\/code><\/pre>\n\n\n\n

Where number is the number you want to round up, and decimal_places<\/strong> is the number of decimal places to which you want to round up.<\/p>\n\n\n\n

For example, to round the number 4.567 up to the nearest whole number<\/strong>, you would use the formula:<\/p>\n\n\n\n

= ROUNDUP(4.567, 0)<\/strong><\/code><\/pre>\n\n\n\n

This would return the value “5”<\/strong><\/p>\n\n\n\n

Custom rounding to a multiple<\/h2>\n\n\n\n

You can also use custom rounding to round to a certain multiple. This can be done by dividing the number by the multiple and then multiplying it by the multiple again.<\/p>\n\n\n\n

For example, to round the number 12.8 to the nearest multiple of 5, you would use the formula:<\/p>\n\n\n\n

= ROUND(12.8\/5,0)*5<\/code><\/strong><\/pre>\n\n\n\n

This would return the value “15”<\/strong><\/p>\n\n\n\n

Conclusion: How to Do Custom Rounding in DAX<\/h2>\n\n\n\n

Custom rounding in DAX allows you to round a number to a specific decimal place or to a certain multiple, which can be useful in a variety of situations such as formatting for visual effects, simplifying calculations, improving data analysis, etc.<\/strong><\/p>\n\n\n\n

However, kindly note that custom rounding can lead to accuracy issues. Thus, it is important to understand the implications of rounding on your data analysis results.<\/p>\n\n\n\n

Thanks for reading.<\/p>\n\n\n\n

I hope you enjoyed reading this article.<\/p>\n\n\n\n

Happy analyzing!<\/p>\n","protected":false},"excerpt":{"rendered":"

In Power BI, DAX provides a ROUND function that can be used to round off numbers to a certain number … <\/p>\n

Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1646,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"yoast_head":"\nHow to Do Custom Rounding in DAX - Monocroft<\/title>\n<meta name=\"description\" content=\"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Do Custom Rounding in DAX - Monocroft\" \/>\n<meta property=\"og:description\" content=\"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\" \/>\n<meta property=\"og:site_name\" content=\"Monocroft\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-21T03:02:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-16T04:39:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"405\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\"},\"author\":{\"name\":\"Matt\",\"@id\":\"https:\/\/monocroft.com\/#\/schema\/person\/3aeab97c9b5661d211c0742c48f024b3\"},\"headline\":\"How to Do Custom Rounding in DAX\",\"datePublished\":\"2023-01-21T03:02:59+00:00\",\"dateModified\":\"2023-03-16T04:39:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\"},\"wordCount\":613,\"publisher\":{\"@id\":\"https:\/\/monocroft.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg\",\"articleSection\":[\"Guides\",\"PowerBI\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\",\"url\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\",\"name\":\"How to Do Custom Rounding in DAX - Monocroft\",\"isPartOf\":{\"@id\":\"https:\/\/monocroft.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg\",\"datePublished\":\"2023-01-21T03:02:59+00:00\",\"dateModified\":\"2023-03-16T04:39:38+00:00\",\"description\":\"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.\",\"breadcrumb\":{\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage\",\"url\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg\",\"contentUrl\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg\",\"width\":720,\"height\":405,\"caption\":\"How to do custom rounding in DAX - monocroft\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/monocroft.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Do Custom Rounding in DAX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/monocroft.com\/#website\",\"url\":\"https:\/\/monocroft.com\/\",\"name\":\"Monocroft\",\"description\":\"Monocroft Tech\",\"publisher\":{\"@id\":\"https:\/\/monocroft.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/monocroft.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/monocroft.com\/#organization\",\"name\":\"Triburge\",\"url\":\"https:\/\/monocroft.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/monocroft.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/07\/monocroft-logo.png\",\"contentUrl\":\"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/07\/monocroft-logo.png\",\"width\":512,\"height\":512,\"caption\":\"Triburge\"},\"image\":{\"@id\":\"https:\/\/monocroft.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/monocroft.com\/#\/schema\/person\/3aeab97c9b5661d211c0742c48f024b3\",\"name\":\"Matt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/monocroft.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c06bcee4d38a649222493c5e9f11f7a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c06bcee4d38a649222493c5e9f11f7a5?s=96&d=mm&r=g\",\"caption\":\"Matt\"},\"url\":\"https:\/\/monocroft.com\/author\/matthew\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Do Custom Rounding in DAX - Monocroft","description":"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/","og_locale":"en_US","og_type":"article","og_title":"How to Do Custom Rounding in DAX - Monocroft","og_description":"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.","og_url":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/","og_site_name":"Monocroft","article_published_time":"2023-01-21T03:02:59+00:00","article_modified_time":"2023-03-16T04:39:38+00:00","og_image":[{"width":720,"height":405,"url":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg","type":"image\/jpeg"}],"author":"Matt","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Matt","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#article","isPartOf":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/"},"author":{"name":"Matt","@id":"https:\/\/monocroft.com\/#\/schema\/person\/3aeab97c9b5661d211c0742c48f024b3"},"headline":"How to Do Custom Rounding in DAX","datePublished":"2023-01-21T03:02:59+00:00","dateModified":"2023-03-16T04:39:38+00:00","mainEntityOfPage":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/"},"wordCount":613,"publisher":{"@id":"https:\/\/monocroft.com\/#organization"},"image":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage"},"thumbnailUrl":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg","articleSection":["Guides","PowerBI"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/","url":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/","name":"How to Do Custom Rounding in DAX - Monocroft","isPartOf":{"@id":"https:\/\/monocroft.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage"},"image":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage"},"thumbnailUrl":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg","datePublished":"2023-01-21T03:02:59+00:00","dateModified":"2023-03-16T04:39:38+00:00","description":"Want to learn how to do custom rounding in DAX? This article explains a step-by-step guide for custom rounding in DAX. Read to learn more.","breadcrumb":{"@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#primaryimage","url":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg","contentUrl":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/01\/How-to-do-custom-rounding-in-DAX-monocroft.jpg","width":720,"height":405,"caption":"How to do custom rounding in DAX - monocroft"},{"@type":"BreadcrumbList","@id":"https:\/\/monocroft.com\/how-to-do-custom-rounding-in-dax\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/monocroft.com\/"},{"@type":"ListItem","position":2,"name":"How to Do Custom Rounding in DAX"}]},{"@type":"WebSite","@id":"https:\/\/monocroft.com\/#website","url":"https:\/\/monocroft.com\/","name":"Monocroft","description":"Monocroft Tech","publisher":{"@id":"https:\/\/monocroft.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/monocroft.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/monocroft.com\/#organization","name":"Triburge","url":"https:\/\/monocroft.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/monocroft.com\/#\/schema\/logo\/image\/","url":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/07\/monocroft-logo.png","contentUrl":"https:\/\/monocroft.com\/wp-content\/uploads\/2023\/07\/monocroft-logo.png","width":512,"height":512,"caption":"Triburge"},"image":{"@id":"https:\/\/monocroft.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/monocroft.com\/#\/schema\/person\/3aeab97c9b5661d211c0742c48f024b3","name":"Matt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/monocroft.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c06bcee4d38a649222493c5e9f11f7a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c06bcee4d38a649222493c5e9f11f7a5?s=96&d=mm&r=g","caption":"Matt"},"url":"https:\/\/monocroft.com\/author\/matthew\/"}]}},"_links":{"self":[{"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/posts\/1645"}],"collection":[{"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/comments?post=1645"}],"version-history":[{"count":71,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/posts\/1645\/revisions"}],"predecessor-version":[{"id":5450,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/posts\/1645\/revisions\/5450"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/media\/1646"}],"wp:attachment":[{"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/media?parent=1645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/categories?post=1645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monocroft.com\/wp-json\/wp\/v2\/tags?post=1645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}