{"id":7079,"date":"2024-01-30T15:19:50","date_gmt":"2024-01-30T15:19:50","guid":{"rendered":"https:\/\/www.stl-training.co.uk\/b\/?p=7079"},"modified":"2024-01-30T15:19:50","modified_gmt":"2024-01-30T15:19:50","slug":"power-bi-dynamic-text-for-reports","status":"publish","type":"post","link":"https:\/\/www.stl-training.co.uk\/b\/power-bi-dynamic-text-for-reports\/","title":{"rendered":"Power BI &#8211; Dynamic Text for More Detailed Reports"},"content":{"rendered":"<p>Visualising data is crucial for decision making in any industry.<\/p>\n<p>Power BI reports are a brilliantly efficient way to achieve this, as users have several useful visual options.<\/p>\n<p>In this blog post you will learn how <a href=\"\/syl\/355\/power-bi-training-courses.html\">Power BI<\/a> can display dynamic text for more detailed reports.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7081 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dyamic-Text-1.jpg\" alt=\"Power BI Dynamic Text\" width=\"1379\" height=\"919\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dyamic-Text-1.jpg 1379w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dyamic-Text-1-300x200.jpg 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dyamic-Text-1-1024x682.jpg 1024w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dyamic-Text-1-768x512.jpg 768w\" sizes=\"(max-width: 1379px) 100vw, 1379px\" \/><\/p>\n<p>We will be using examples of sales data and HR data, but the logic, methods, and techniques can be used across all different industries, such as finance, healthcare, and retail and across all types of data sets.<\/p>\n<h2><strong>DAX<\/strong><\/h2>\n<p>To get the full benefit from this blog post, some experience and knowledge about DAX (<strong>D<\/strong>ata <strong>A<\/strong>nalysis e<strong>X<\/strong>pressions) is needed. We will use some <a href=\"\/syl\/356\/dax-bi-training-courses-london.html\">DAX<\/a> functions, but you could use a huge number of different DAX functions to create Dynamic text for more detailed reports.<\/p>\n<h2><strong>Power BI Report Visuals<\/strong><\/h2>\n<p>You have different options to provide your audience explanations or additional information to your Power BI report\u2019s visuals. You can let Power BI desktop search for key influencers in your data model based on the visual by using the Artificial Intelligence Visual Smart Narrative.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7082 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-2.png\" alt=\"Power BI Dynamic Text\" width=\"624\" height=\"256\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-2.png 624w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-2-300x123.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>You can write DAX measures and be in fully control of the text displayed in a text box (see the example below and the DAX used to achieve the example text).<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7083 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-3.png\" alt=\"Power BI Dynamic Text\" width=\"624\" height=\"225\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-3.png 624w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-3-300x108.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>Dyn text =<\/p>\n<p>&#8221; The line chart above shows Profit for &#8221; &amp; VALUES ( Customers[Country] ) &amp; &#8221; over years by customer segment. The Sales growth for &#8221;<\/p>\n<p>&amp; VALUES ( Customers[Country] ) &amp; &#8221; is &#8221;<\/p>\n<p>&amp; FORMAT ( [Growth], &#8220;0.00&#8221; ) &amp; &#8220;%, and the best selling product in &#8221;<\/p>\n<p>&amp; VALUES ( Customers[Country] ) &amp; &#8221; is &#8221;<\/p>\n<p>&amp; CONCATENATEX (<\/p>\n<p>TOPN ( 1, \u00a0values(Items[Product Description]), [Sales],DESC ),<\/p>\n<p>[Product Description],<\/p>\n<p>&#8220;;&#8221;<\/p>\n<p>) &amp; &#8220;. At the moment we have &#8221;<\/p>\n<p>&amp; COUNT ( Customers[Customer Id] ) &amp; &#8221; customers in &#8221;<\/p>\n<p>&amp; VALUES ( Customers[Country] ) &amp; &#8221; and the average order sales is &#8221;<\/p>\n<p>&amp; FORMAT ( DIVIDE ( [Sales], COUNTROWS ( Orders ), 0 ), &#8220;currency&#8221;, &#8220;en-gb&#8221; ) &amp; &#8220;, and average quantity per order is &#8221;<\/p>\n<p>&amp; FORMAT (<\/p>\n<p>DIVIDE ( SUM ( Line_Items[Quantity] ), COUNTROWS ( orders ), 0 ),<\/p>\n<p>&#8220;0,00&#8221;<\/p>\n<p>) &amp; &#8221; units.&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>The DAX in this example will take to account any filtering on the report page and change the dynamic text based on the filters.<\/p>\n<p>You can use a combination of the two options, and you can also use the AI tool Q&amp;A to generate your dynamic text boxes. Furthermore, you can create Custom Tooltips with dynamic text which will popup when your audience hover over visuals.<\/p>\n<p>In Power BI desktop all dynamic text will be underlined (a blue line) and cannot be changed, but when the report has been published and shared, the audience will not see the blue lines.<\/p>\n<h2><strong>Example 1 \u2013 Combination of Smart Narrative and your own DAX measures and text.<\/strong><\/h2>\n<p>A line chart visual displaying sales over years and months has been selected and to get Power BI desktop to generate the text you will have to click \u201cNarrative\u201d\u00a0on the\u00a0Insert tab\u00a0in the\u00a0AI\u00a0Visuals\u00a0group.<\/p>\n<p>You will get a text box where Power BI will write AI text based on the data set and selected visual.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7084 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-4.png\" alt=\"Power BI Dynamic Text\" width=\"610\" height=\"422\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-4.png 610w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-4-300x208.png 300w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/p>\n<p>You cannot control the AI text the Narrative tool writes, but to add your own text, just click inside the text box and type. The text \u201cThe total sales for all months\u201d is entered here. After the added text, the total sales amount is going to be displayed.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7085 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-5.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"477\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-5.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-5-300x158.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-5-768x406.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>When you click inside the text box a tool bar will appear. Click +VALUE and you can type in the DAX measure you want to display the result from. Here I want to display the result from a DAX measure called sales. I have formatted the result as currency, and I named the result \u201ctotsales.\u201d The name can be used to display the result somewhere else in the text box.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7086 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-6.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"572\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-6.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-6-300x190.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-6-768x486.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>In the same text box, you may want to explain to the audience, how the visual and the information have been filtered. In this example a slicer has been added to page to filter the data by country.<\/p>\n<p>The following DAX measure will pick up if the column with the heading Country in the table \u201ctblsales\u201d is filtered. If it is, it will return the country name selected from the slicer. Otherwise, it will return the text string &#8221; all countries&#8221;.<\/p>\n<p>Filtered countries = if(ISFILTERED(tblsales[Country]),SELECTEDVALUE(tblsales[Country]),&#8221;all countries&#8221;)<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7087 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-7.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"515\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-7.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-7-300x171.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-7-768x438.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>If you look at the screenshot above, you can see that the total sales amount is added to the text box and a new line at the top has been typed: <strong><br \/>\n\u201cThis page visuals and the information in this text box display data from\u201d<\/strong><\/p>\n<p>Place the mouse course where you want to add the dynamic text and click \u201c+Value\u201d and again the options will appear.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7088 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-8.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"558\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-8.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-8-300x185.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-8-768x475.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>Now the text will show this if the page has not been filtered by country:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7089 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-9.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"476\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-9.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-9-300x158.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-9-768x405.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>And this if the page has been filtered by \u201cUK\u201d:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7090 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-10.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"481\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-10.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-10-300x160.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-10-768x409.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<h2><strong>Example 2 \u2013 Combination of Q&amp;A artificial intelligence and your own DAX measures and text.<\/strong><\/h2>\n<p>If you do not want the smart narrative dynamic text, you can use the same method as in example 1 above. You will then just need to add a text box to the page.<\/p>\n<p>In this example you will also see how the artificial intelligence tool Q&amp;A can benefit you when you are creating dynamic text.<\/p>\n<p>If we type \u201cThe percentage sales margin for\u201d in a text box, then as in example 1 the DAX measure Filtered countries is used to return the country selected from the slicer. Then \u201cis\u201d is typed and then as in example 1, where a measure called Sales was added, another measure is added where the percentage sales margin was calculated. The same has been done to get the result from a profit measure.<\/p>\n<p>At this point, the text box displays:<\/p>\n<p>The percentage sales margin for Canada is 49.19 %,<\/p>\n<p>the profit for Canada is \u00a3269,079,481,<\/p>\n<p>and the total quantity for Canada is<\/p>\n<p>&nbsp;<\/p>\n<p>You will not even always have to do measures to return calculated results in dynamic text. Here the artificial intelligence tool Q&amp;A can be particularly useful.<\/p>\n<p>To get the total quantity in the text box click \u201c+Value.\u201d<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7091 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-11.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"564\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-11.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-11-300x187.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-11-768x480.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>This will look in your data set and find a column with the name quantity and sum all the values in the column.<\/p>\n<p>You will need to know your column headers.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7092 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-12.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"594\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-12.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-12-300x197.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-12-768x505.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>\u201ctop 1 ClientName profit\u201d Q&amp;A will look in the column ClientName and find top 1 client\u2019s value based on a measure called profit.<\/p>\n<p>And the result will look like this:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7093 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-13.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"492\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-13.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-13-300x163.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-13-768x418.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>And this:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7094 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-14.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"572\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-14.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-14-300x190.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-14-768x486.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>Will return the name of top 1 client based on profit.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7095 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-15.png\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"500\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-15.png 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-15-300x166.png 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/dynamic-text-15-768x425.png 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<h2><strong>Example 3 \u2013 Dynamic text in custom Tooltips for more detailed reports.<\/strong><\/h2>\n<p>The methods are the same as above! The only difference is that the text box needs to be created on a tooltip page.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-7096 size-full\" src=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-16.jpg\" alt=\"Power BI Dynamic Text\" width=\"903\" height=\"506\" srcset=\"https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-16.jpg 903w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-16-300x168.jpg 300w, https:\/\/www.stl-training.co.uk\/b\/wp-content\/uploads\/2024\/01\/Dynamic-text-16-768x430.jpg 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/p>\n<p>The dynamic text is also filtered by the data point you hover over on the visual. In the screen shot above, the mouse courser is on top of the data point for August 2019.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>You can add much more information to your reports by creating dynamic text boxes. They enable you to explain the visuals, you can also point out specific details, which are important for the audience.<\/p>\n<p>Filtering can be confusing in a Power BI report for the audience, but as you saw in this blog post, you can explain filters in dynamic text.<\/p>\n<h2><strong>Further Reading:<\/strong><\/h2>\n<p><a href=\"https:\/\/www.stl-training.co.uk\/b\/power-bi-artificial-intelligence-visuals-part-1-qa\/\">https:\/\/www.stl-training.co.uk\/b\/power-bi-artificial-intelligence-visuals-part-1-qa\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visualising data is crucial for decision making in any industry. Power BI reports are a brilliantly efficient way to achieve this, as users have several useful visual options. In this blog post you will learn how Power BI can display dynamic text for more detailed reports. We will be using examples of sales data and [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23,8,650],"tags":[664,894,649],"class_list":["post-7079","post","type-post","status-publish","format-standard","hentry","category-data-visualisation","category-microsoft","category-power-bi","tag-dax","tag-dynamic-text","tag-power-bi"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/posts\/7079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/comments?post=7079"}],"version-history":[{"count":6,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/posts\/7079\/revisions"}],"predecessor-version":[{"id":7138,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/posts\/7079\/revisions\/7138"}],"wp:attachment":[{"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/media?parent=7079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/categories?post=7079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stl-training.co.uk\/b\/wp-json\/wp\/v2\/tags?post=7079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}