{"id":6970,"date":"2022-09-23T05:00:33","date_gmt":"2022-09-23T04:00:33","guid":{"rendered":"https:\/\/bestdatasolutions.es\/?p=6970"},"modified":"2022-10-11T14:45:31","modified_gmt":"2022-10-11T13:45:31","slug":"text-formatting-with-dax","status":"publish","type":"post","link":"https:\/\/bestdatasolutions.es\/en\/blog\/text-formatting-with-dax\/","title":{"rendered":"Text formatting with DAX"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"6970\" class=\"elementor elementor-6970 elementor-6969\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d32b5ac elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"d32b5ac\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c1dc6d3\" data-id=\"c1dc6d3\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-911012a elementor-widget elementor-widget-theme-post-featured-image elementor-widget-image\" data-id=\"911012a\" data-element_type=\"widget\" data-widget_type=\"theme-post-featured-image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1920\" height=\"500\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax.jpg\" class=\"attachment-full size-full wp-image-7037\" alt=\"powerbi-text-formatting-dax\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax.jpg 1920w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax-300x78.jpg 300w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax-1024x267.jpg 1024w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax-768x200.jpg 768w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/powerbi-text-formatting-dax-1536x400.jpg 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5d1c2c13 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5d1c2c13\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-5aae2e0d\" data-id=\"5aae2e0d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1a3ffa42 elementor-author-box--layout-image-left elementor-author-box--align-left elementor-author-box--image-valign-middle elementor-author-box--avatar-yes elementor-author-box--name-yes elementor-author-box--biography-yes elementor-widget elementor-widget-author-box\" data-id=\"1a3ffa42\" data-element_type=\"widget\" data-widget_type=\"author-box.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-author-box\">\n\t\t\t\t\t\t\t<a href=\"https:\/\/www.linkedin.com\/in\/javierriosponce\/\" target=\"_blank\" class=\"elementor-author-box__avatar\" rel=\"noopener\">\n\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/avatar_user_4_1633610531.jpg\" alt=\"Picture of Javier R\u00edos\" loading=\"lazy\" title=\"\">\n\t\t\t\t<\/a>\n\t\t\t\n\t\t\t<div class=\"elementor-author-box__text\">\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/www.linkedin.com\/in\/javierriosponce\/\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t<h4 class=\"elementor-author-box__name\">\n\t\t\t\t\t\t\tJavier R\u00edos\t\t\t\t\t\t<\/h4>\n\t\t\t\t\t<\/a>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-author-box__bio\">\n\t\t\t\t\t\tBusiness Intelligence Consultant | Marketing Expert | Data Specialist\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-41a959e0 elementor-widget elementor-widget-heading\" data-id=\"41a959e0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-large\">Other Articles:<\/h3>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-6c75b22c\" data-id=\"6c75b22c\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5795bde9 elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading\" data-id=\"5795bde9\" data-element_type=\"widget\" data-widget_type=\"theme-post-title.default\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-xl\">Text formatting with DAX<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-561b31d1 elementor-widget elementor-widget-post-info\" data-id=\"561b31d1\" data-element_type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-869d2fb elementor-inline-item\" itemprop=\"datePublished\">\n\t\t\t\t\t\t<a href=\"https:\/\/bestdatasolutions.es\/en\/2022\/09\/23\/\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-calendar\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm436-44v-36c0-26.5-21.5-48-48-48h-48V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H160V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v36c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12z\"><\/path><\/svg>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-date\">\n\t\t\t\t\t\t\t\t\t\t<time>23\/09\/2022<\/time>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7476169 elementor-share-buttons--view-icon-text elementor-share-buttons--skin-gradient elementor-share-buttons--shape-square elementor-grid-0 elementor-share-buttons--color-official elementor-widget elementor-widget-share-buttons\" data-id=\"7476169\" data-element_type=\"widget\" data-widget_type=\"share-buttons.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-grid\" role=\"list\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_linkedin\" role=\"button\" tabindex=\"0\" aria-label=\"Share on linkedin\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-linkedin\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z\"><\/path><\/svg>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-share-btn__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__title\">\n\t\t\t\t\t\t\t\t\t\tLinkedIn\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_facebook\" role=\"button\" tabindex=\"0\" aria-label=\"Share on facebook\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-facebook\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z\"><\/path><\/svg>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-share-btn__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__title\">\n\t\t\t\t\t\t\t\t\t\tFacebook\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_twitter\" role=\"button\" tabindex=\"0\" aria-label=\"Share on twitter\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-twitter\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z\"><\/path><\/svg>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-share-btn__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__title\">\n\t\t\t\t\t\t\t\t\t\tTwitter\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_whatsapp\" role=\"button\" tabindex=\"0\" aria-label=\"Share on whatsapp\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-whatsapp\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z\"><\/path><\/svg>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"elementor-share-btn__text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__title\">\n\t\t\t\t\t\t\t\t\t\tWhatsApp\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-56263e9 elementor-widget elementor-widget-text-editor\" data-id=\"56263e9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Power BI is a great tool for data visualisation. It has many different visualisations that adapt to practically any need and periodically introduces improvements to implement new features often required by the immense user community.<\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">However, sometimes we come across a feature needed for our designs that has not yet been implemented for which there is apparently no short-term solution. It is at these moments that creativity and knowledge of the tool and DAX can help us overcome these obstacles.<\/span><\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">Today I present a particular case where a client needed a specific format for part of the text in a table. Among the formatting options offered by Power BI for this visualisation, we do not have the option of establishing a specific formatting for a part of the text in certain boxes. Nor is there a DAX for formatting. So&#8230; can it be done? Now we&#8217;ll see!<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2d03de5 elementor-widget elementor-widget-video\" data-id=\"2d03de5\" data-element_type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/Xs3o4-L8V6s&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9682288 elementor-widget elementor-widget-heading\" data-id=\"9682288\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Understanding the need<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e0fef0a elementor-widget elementor-widget-text-editor\" data-id=\"e0fef0a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>First, let&#8217;s look at the need. The client needs us to create a visualisation where he can see the weekly planning of their teaching staff. He needs to get something like that:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-68e2e49 elementor-widget elementor-widget-image\" data-id=\"68e2e49\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"194\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-objetivo.jpg\" class=\"attachment-large size-large wp-image-6988\" alt=\"Power BI DAX Text Formatting Target\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-objetivo.jpg 800w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-objetivo-300x73.jpg 300w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-objetivo-768x186.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8868012 elementor-widget elementor-widget-text-editor\" data-id=\"8868012\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>As can be seen, we have 2 tasks that, at first glance, do not seem feasible to perform in Power BI:<\/p><ul><li>The box has part of the text in bold and part of the text in normal format.<\/li><li>The box distributes the text on 2 separate rows (timetable above, subject below).<\/li><\/ul><div> <\/div><p>If we look through the formatting possibilities of the visual, we will obviously not find anything of the sort. <\/p><p>The first possible solution that came to my mind was to insert HTML tags like &lt;b&gt;,  &lt;i&gt;,  &lt;p&gt;,  &lt;br \/&gt; in the text box but it did not work as Power BI does not interpret them as code but as text. <\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">Then I also tried using special web language character codes within the text like o \u00e0 but that didn&#8217;t work either. It was at this point that I remembered a DAX function capable of fetching me almost any Unicode character which, virtually, would open the door to a solution: UNICHAR().<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4050e5e elementor-widget elementor-widget-heading\" data-id=\"4050e5e\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What is Unicode?<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d4608d8 elementor-widget elementor-widget-text-editor\" data-id=\"d4608d8\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Unicode is a universal character encoding standard that defines each character or symbol of almost any alphabet by a unique numeric identifier. Therefore, the character &#8220;A&#8221; in Unicode would be &#8220;41&#8221;. Unicode also includes a specific code for all Emojis, statistical symbols, mathematical symbols&#8230; and this is where it comes to our rescue.<\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">Between the coded symbols there are mathematical series that simulate bold or italic characters and numbers in serif and sans serif styles&#8230; and that&#8217;s all we need!<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fc2cc90 elementor-widget elementor-widget-heading\" data-id=\"fc2cc90\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">So... what is the solution?<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-aa87be5 elementor-widget elementor-widget-text-editor\" data-id=\"aa87be5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>What we are going to do is to replace each &#8220;normal&#8221; character we want with its Unicode Bold equivalent, which is the format the client needs. For this we will use the SUBSTITUTE() and UNICHAR() functions together. That is, we are going to make a text format with DAX.<\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">But one thing that will be essential is to know which characters we want to replace and their Unicode equivalent. For this purpose, there are sites such as <\/span><a href=\"https:\/\/yaytext.com\/es\/\" target=\"_blank\" rel=\"noopener\">https:\/\/yaytext.com\/es\/<\/a> <span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">which allow you to enter a text and see the possible variants of it:<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2130839 elementor-widget elementor-widget-image\" data-id=\"2130839\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"706\" height=\"533\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-yaytext.jpg\" class=\"attachment-large size-large wp-image-6978\" alt=\"Power BI DAX Yaytext Text Formatting\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-yaytext.jpg 706w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-yaytext-300x226.jpg 300w\" sizes=\"(max-width: 706px) 100vw, 706px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-79eb62c elementor-widget elementor-widget-text-editor\" data-id=\"79eb62c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In this case, the style I am interested in is &#8220;Bold (serif)&#8221;. To find out which Unicode code corresponds to which character, copy each character from the result and paste it into a Unicode code search engine such as <a href=\"https:\/\/unicodelookup.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/unicodelookup.com\/<\/a>, where the code we are interested in is &#8220;Dec&#8221; (for decimal):<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-473d785 elementor-widget elementor-widget-image\" data-id=\"473d785\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"302\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-unicode-lookup.jpg\" class=\"attachment-large size-large wp-image-6980\" alt=\"Power BI DAX Unicode-Lookup Text Formatting\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-unicode-lookup.jpg 600w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-unicode-lookup-300x151.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2a20444 elementor-widget elementor-widget-heading\" data-id=\"2a20444\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Practical implementation<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1671ec0 elementor-widget elementor-widget-text-editor\" data-id=\"1671ec0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Now it is time to understand the proposed solution to perform text formatting with DAX. The following is the data table we originally had:<br><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e0ee6a6 elementor-widget elementor-widget-image\" data-id=\"e0ee6a6\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"518\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-tabla-inicial.jpg\" class=\"attachment-large size-large wp-image-6984\" alt=\"Power BI DAX Text Formatting Initial Table\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-tabla-inicial.jpg 596w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-tabla-inicial-300x261.jpg 300w\" sizes=\"(max-width: 596px) 100vw, 596px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bbf852b elementor-widget elementor-widget-text-editor\" data-id=\"bbf852b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>There are many ways to approach the solution but, in my case, as I only need to replace the numbers from 0 to 9, I have chosen to create a column and use a simple code that, iteratively, searches one by one for the different characters that we want to replace and changes them for their bold equivalents using Unicode code:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-05965fe elementor-widget elementor-widget-code-highlight\" data-id=\"05965fe\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>SUSTITUIR = \r\nVAR S0 = SUBSTITUTE(Principal[HORARIO],\"0\",UNICHAR(120812))\r\nVAR S1 = SUBSTITUTE(S0,\"1\",UNICHAR(120813))\r\nVAR S2 = SUBSTITUTE(S1,\"2\",UNICHAR(120814))\r\nVAR S3 = SUBSTITUTE(S2,\"3\",UNICHAR(120815))\r\nVAR S4 = SUBSTITUTE(S3,\"4\",UNICHAR(120816))\r\nVAR S5 = SUBSTITUTE(S4,\"5\",UNICHAR(120817))\r\nVAR S6 = SUBSTITUTE(S5,\"6\",UNICHAR(120818))\r\nVAR S7 = SUBSTITUTE(S6,\"7\",UNICHAR(120819))\r\nVAR S8 = SUBSTITUTE(S7,\"8\",UNICHAR(120820))\r\nVAR S9 = SUBSTITUTE(S8,\"9\",UNICHAR(120821))\r\nRETURN\r\nS9<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ea5550a elementor-widget elementor-widget-text-editor\" data-id=\"ea5550a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Our table now looks like this:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-48a02c0 elementor-widget elementor-widget-image\" data-id=\"48a02c0\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"471\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-texto-formateado.jpg\" class=\"attachment-large size-large wp-image-6982\" alt=\"Power BI DAX Formatted Text Format\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-texto-formateado.jpg 631w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-texto-formateado-300x224.jpg 300w\" sizes=\"(max-width: 631px) 100vw, 631px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a27782d elementor-widget elementor-widget-text-editor\" data-id=\"a27782d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Obviously, if we needed to modify many more characters, the approach would be different in order to simplify the code as much as possible. <\/p><p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">Now that we have the timetable in bold, we want to have both the timetable in bold and the subject in a single field, in this case with standard formatting and on a separate line. To do this, we create a new column where we join both columns and use the UNICHAR(10) character between them, which generates a line break:<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0d399a0 elementor-widget elementor-widget-code-highlight\" data-id=\"0d399a0\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>Texto-Formateado = Principal[SUSTITUIR] & UNICHAR(10) & Principal[CONCEPTO]<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-87dde41 elementor-widget elementor-widget-image\" data-id=\"87dde41\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"510\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-codigo-dax-resultado-celda.jpg\" class=\"attachment-large size-large wp-image-6990\" alt=\"Power BI DAX Formatting Result\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-codigo-dax-resultado-celda.jpg 779w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-codigo-dax-resultado-celda-300x196.jpg 300w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-codigo-dax-resultado-celda-768x503.jpg 768w\" sizes=\"(max-width: 779px) 100vw, 779px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1a77739 elementor-widget elementor-widget-text-editor\" data-id=\"1a77739\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>We can see that the result shows us everything in the same line but, once we take this field to the table or matrix, it will show the information as we need it.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-53ce019 elementor-widget elementor-widget-image\" data-id=\"53ce019\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"384\" src=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-situacion-general.jpg\" class=\"attachment-large size-large wp-image-6986\" alt=\"Power BI DAX Formatting General Situation\" srcset=\"https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-situacion-general.jpg 800w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-situacion-general-300x144.jpg 300w, https:\/\/bestdatasolutions.es\/wp-content\/uploads\/power-bi-dax-text-format-situacion-general-768x369.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" title=\"\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c543f3f elementor-widget elementor-widget-heading\" data-id=\"c543f3f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d071208 elementor-widget elementor-widget-text-editor\" data-id=\"d071208\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>As indicated above, UNICHAR() can not only be used to insert special characters but also Emojis and others. That is, we could use lists like the ones found&nbsp;<a href=\"https:\/\/unicode.org\/emoji\/charts\/full-emoji-list.html\" target=\"_blank\" rel=\"noopener\">here<\/a> &nbsp; to obtain the code of flags of any country, arrows, signage, faces &#8230; the possibilities are almost endless and allow you to give a very visual original touch to any design without having to prepare and load each of the images. If this resource is used, it is important to remember that the codes we use in UNICHAR() must be decimal, so in case of Hexadecimal codes it is necessary to convert them.<\/p>\n<p><span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem; font-weight: var( --e-global-typography-text-font-weight );\">UNICHAR() and a little imagination can certainly open the door to more advanced and complete design solutions for our developments. What use can you think of?<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-614b2ec9 elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"614b2ec9\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c77df54 elementor-align-center elementor-widget elementor-widget-button\" data-id=\"c77df54\" data-element_type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/bestdatasolutions.es\/en\/blog\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">&lt;&lt; BACK TO BLOG<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>There are times when the text formatting possibilities in Power BI tables are somewhat limited for our needs. Is it possible to apply Text formatting with DAX in Power BI? Now we&#8217;ll see!<\/p>\n","protected":false},"author":4,"featured_media":7037,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[75],"class_list":["post-6970","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-powerbi-en"],"_links":{"self":[{"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/posts\/6970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/comments?post=6970"}],"version-history":[{"count":0,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/posts\/6970\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/media\/7037"}],"wp:attachment":[{"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/media?parent=6970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/categories?post=6970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bestdatasolutions.es\/en\/wp-json\/wp\/v2\/tags?post=6970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}