{"id":33963,"date":"2024-04-17T15:50:30","date_gmt":"2024-04-17T10:50:30","guid":{"rendered":"https:\/\/chartexpo.com\/blog\/?p=33963"},"modified":"2026-01-29T17:10:57","modified_gmt":"2026-01-29T12:10:57","slug":"contains-dax","status":"publish","type":"post","link":"https:\/\/chartexpo.com\/blog\/contains-dax","title":{"rendered":"How and When to Use CONTAINS function (DAX)?"},"content":{"rendered":"<p>Have you ever heard of the CONTAINS DAX function?<\/p>\n<p>It&#8217;s the sneaky little wizard hidden within Power BI that can work wonders with your data.<\/p>\n<p>You might think it&#8217;s just another function, but oh, it&#8217;s so much more. The CONTAINS DAX function is like that secret spice that takes your data recipes from bland to grand.<\/p>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" style=\"max-width: 100%;\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax.jpg\" alt=\"contains DAX\" \/><\/a><\/div>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytwYitjZXhwbytQQkk1MzErQ29tcGFyaXNvbis=\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-power-bi.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytncytjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-google-sheets.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZyt4bCtjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-microsoft-excel.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><\/div>\n<p>So, why all the fuss about DAX CONTAINS?<\/p>\n<p>The CONTAINS DAX function is a game-changer. It allows you to check for the presence of a substring within a string. For instance, you can use CONTAINS DAX to search for specific keywords within a text field. Moreover, you can use it to identify and categorize customer feedback, unlocking valuable customer sentiment insights.<\/p>\n<p>This function opens up a world of possibilities for data manipulation and analysis. Its ability to handle complex filtering conditions makes it an indispensable asset for anyone working with large datasets.<\/p>\n<p>In this blog post, we&#8217;ll uncover why CONTAINS DAX is the unsung hero of data analysis. We&#8217;ll explore its significance and how it revolutionizes data analysis in Power BI. By the end, you&#8217;ll wield the power of data like a seasoned pro, conjuring insights with a click.<\/p>\n<h3>Table of Content:<\/h3>\n<ol>\n<li><a href=\"#tb1\">Define Contains DAX Function<\/a><\/li>\n<li><a href=\"#tb2\">What is the Purpose of Using the CONTAINS DAX Function?<\/a><\/li>\n<li><a href=\"#tb3\">Why is Power BI CONTAINS DAX Function Important?<\/a><\/li>\n<li><a href=\"#tb4\">Contains DAX Function: Step-by-Step Implementation for Data Evaluation<\/a><\/li>\n<li><a href=\"#tb5\">Creating Engaging Data Narratives in Power BI<\/a><\/li>\n<li><a href=\"#wrap-up\">Wrap Up<\/a><\/li>\n<\/ol>\n<h2 id=\"tb1\">Define Contains DAX Function<\/h2>\n<p><strong>Definition:<\/strong>\u00a0The CONTAINS DAX function is a robust tool in Power BI tailored for data manipulation and analysis. It functions like a virtual detective, meticulously scanning text fields to pinpoint particular substrings or patterns. This function yields a Boolean result, signaling whether the designated substring is present within the text.<\/p>\n<p>Here&#8217;s the basic syntax: <strong>CONTAINS( Table, Column, SearchValue )<\/strong><\/p>\n<p>Whether you&#8217;re hunting for keywords, exploring patterns, or conducting targeted searches, the CONTAINS DAX function stands as your analytical ally. In scenarios demanding a focused lens on data scrutiny, it proves invaluable, enabling efficient extraction of relevant information.<\/p>\n<p>The precision and flexibility of CONTAINS DAX make it a key player in the data analyst&#8217;s toolkit, unlocking myriad possibilities for dissecting and interpreting textual information with finesse.<\/p>\n<h2 id=\"tb2\">What is the Purpose of Using the CONTAINS DAX Function?<\/h2>\n<p>Let&#8217;s unravel the purpose behind wielding the CONTAINS DAX function. This function serves as a strategic instrument for navigating the labyrinth of data.<\/p>\n<ol>\n<li><strong>Substring detection:<\/strong>\u00a0The primary purpose of the CONTAINS DAX function is substring detection. It acts as a virtual Sherlock Holmes, scrutinizing text fields to ascertain the existence of specific substrings. This capability is invaluable when seeking elusive patterns, keywords, or unique identifiers within a sea of data.<\/li>\n<li><strong>Filtering and matching:<\/strong>\u00a0Think of CONTAINS DAX as a sophisticated filter, allowing you to sift through vast <a href=\"https:\/\/chartexpo.com\/blog\/power-bi-dataset\" target=\"_blank\" rel=\"noopener noreferrer\">datasets<\/a> with surgical precision. It enables the isolation of records that contain the desired substring. Consequently, it streamlines the analytical process and facilitates targeted exploration of relevant information.<\/li>\n<li><strong>Precision in data analysis:<\/strong> Precision is the cornerstone of effective <a href=\"https:\/\/chartexpo.com\/blog\/data-visualization-guide\" target=\"_blank\" rel=\"noopener noreferrer\">data visualization<\/a>. You can extract what you need using CONTAINS DAX, avoiding the noise and zeroing in on the crucial details. This function enhances the accuracy of insights, ensuring decisions are based on a refined understanding of data in <a href=\"https:\/\/chartexpo.com\/blog\/power-bi-for-mac\" target=\"_blank\" rel=\"noopener noreferrer\">Power BI for Mac<\/a>.<\/li>\n<li><strong>Conditional logic:<\/strong>\u00a0CONTAINS DAX introduces a layer of conditional logic into the analytical toolkit. Its ability to return true or false values based on substring presence allows for creating dynamic, logic-driven analyses. This conditional power adds flexibility to data exploration and supports the development of nuanced <a href=\"https:\/\/chartexpo.com\/blog\/best-business-intelligence-platform\" target=\"_blank\" rel=\"noopener noreferrer\">business intelligence solutions<\/a>.<\/li>\n<\/ol>\n<h2 id=\"tb3\">Why is Power BI CONTAINS DAX Function Important?<\/h2>\n<p>Here are the reasons why the Power BI CONTAINS DAX function is a linchpin in business intelligence.<\/p>\n<ul>\n<li><strong>Flexible filtering:<\/strong> The CONTAINS DAX function and <a href=\"https:\/\/chartexpo.com\/blog\/format-dax\" target=\"_blank\" rel=\"noopener noreferrer\">Format DAX<\/a> in Power BI empower you with flexible filtering capabilities. It acts as a dynamic gatekeeper, allowing you to extract specific data points containing the desired substring. This flexibility enhances precision in analysis, ensuring that only relevant information is brought to the forefront.<\/li>\n<li><strong>Substring matching:<\/strong> At its core, CONTAINS DAX specializes in substring matching. It transforms the search for specific patterns or keywords within text fields into a streamlined process. This capability is invaluable for analysts seeking to unravel intricate details within expansive datasets.<\/li>\n<li><strong>Advanced conditional logic:<\/strong> CONTAINS DAX in <a href=\"https:\/\/chartexpo.com\/blog\/power-bi-advanced\" target=\"_blank\" rel=\"noopener noreferrer\">Power BI advanced<\/a> conditional logic into the analytical toolkit. It facilitates the creation of intricate logic-driven analyses by providing a true or false output based on substring presence. This nuanced approach supports complex <a href=\"https:\/\/chartexpo.com\/blog\/data-driven-decision-making\" target=\"_blank\" rel=\"noopener noreferrer\">decision-making processes<\/a>.<\/li>\n<li><strong>Improved data visualization:<\/strong> Effective data visualization hinges on accurate and relevant information. The CONTAINS DAX function contributes to this by allowing you to filter and visualize data precisely. It enhances the clarity of visual representations, making <a href=\"https:\/\/chartexpo.com\/blog\/power-bi-dashboard-vs-report\" target=\"_blank\" rel=\"noopener noreferrer\">reports and dashboards<\/a> more insightful and actionable.<\/li>\n<li><strong>Enhanced data exploration: <\/strong>When navigating vast datasets, the CONTAINS DAX function acts as a compass, guiding you to the information you seek and helping you visualize results clearly through <a href=\"https:\/\/chartexpo.com\/tools\/power-bi-custom-visuals\" target=\"_blank\" rel=\"noopener\">Power BI charts<\/a>. This enables you to delve deeper into specific aspects without getting lost in the data wilderness.<\/li>\n<li><strong>Efficient data manipulation:<\/strong> Efficiency is paramount in data manipulation, and CONTAINS DAX is a time-saving ally. Whether extracting specific subsets of data or conducting targeted analyses, this function streamlines the process. Consequently, it allows for more efficient data manipulation and extraction of meaningful insights.<\/li>\n<\/ul>\n<h2 id=\"tb4\">Contains DAX Function: Step-by-Step Implementation for Data Evaluation<\/h2>\n<p>Here is the CONTAINS DAX function syntax breakdown:<\/p>\n<p><strong>CONTAINS(&lt;table&gt;, &lt;column&gt;, &lt;value&gt;)<\/strong><\/p>\n<ul>\n<li>&lt;table&gt;: Refers to the table or table expression you want to search.<\/li>\n<li>&lt;column&gt;: Denotes the column within the specified table where you want to search for the specified value.<\/li>\n<li>&lt;value&gt;: Represents the value you are searching for within the specified column.<\/li>\n<\/ul>\n<p>The function yields a TRUE result when the specified value is located in the designated column of the table. Otherwise, it returns FALSE.<\/p>\n<h3>Example:<\/h3>\n<p>The following dataset contains two columns: category and sub-category.<\/p>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax-1.png\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax-1.png\" alt=\"contains DAX 1\" width=\"237\" \/><\/a><\/div>\n<p>Suppose you want to check if the value \u201cOffice Supplies\u201d exists in the Category column:<\/p>\n<p><strong>Text_Contains =CONTAINS (&#8216;Global-Superstore&#8217;,&#8217;Global-Superstore'[Category], &#8220;Office Supplies&#8221;)<\/strong><\/p>\n<p>After committing the DAX, let&#8217;s drag the measure into the table visual next to the Sub-category column.<\/p>\n<p>As you can see, the CONTAINS function evaluates values in each category row. It returns True if the category contains &#8220;Office Supplies.&#8221; And if the category lacks the value, it returns False.<\/p>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax-2.png\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/contains-dax-2.png\" alt=\"contains DAX 2\" width=\"395\" \/><\/a><\/div>\n<h2 id=\"tb5\">Creating Engaging Data Narratives in Power BI<\/h2>\n<p>We&#8217;ve learned how to use CONTAINS in Power BI. Follow these steps to harness the robust features of Power BI with <a href=\"https:\/\/chartexpo.com\/charts\/sankey-diagram\" target=\"_blank\" rel=\"noopener noreferrer\">Sankey Diagram<\/a> for effective data visualization.<\/p>\n<h3>Stage 1: Logging in to Power BI<\/h3>\n<ol>\n<li>Log in to Power BI.<\/li>\n<li>Enter your email address and click the \u201c<strong>Submit<\/strong>\u201d button.<\/li>\n<\/ol>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/enter-email-to-login-to-power-bi.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/enter-email-to-login-to-power-bi.jpg\" alt=\"Enter email to login to Power BI\" width=\"650\" \/><\/a><\/div>\n<ul>\n<li>You are redirected to your Microsoft account.<\/li>\n<li>Enter your password and click \u201c<strong>Sign in<\/strong>\u201c.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/enter-password-to-login-to-power-bi.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/enter-password-to-login-to-power-bi.jpg\" alt=\"Enter Password to login to Power BI\" width=\"363\" \/><\/a><\/div>\n<ul>\n<li>You can choose whether to stay signed in.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/click-on-stay-signed-in.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/05\/click-on-stay-signed-in.jpg\" alt=\"Click on stay signed in\" width=\"392\" \/><\/a><\/div>\n<div>\n<ul>\n<li>Once done, the Power BI home screen will open.<\/li>\n<\/ul>\n<\/div>\n<h4>Stage 2: Creating a Data Set and Selecting the Data Set to Use in Your Chart<\/h4>\n<ul>\n<li>Go to the left-side menu and click the \u201c<strong>Create<\/strong>\u201d button.<\/li>\n<li>Select \u201c<strong>Paste or manually enter data<\/strong>\u201c.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/02\/select-paste-or-manually-enter-data-in-power-bi-ce487.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/02\/select-paste-or-manually-enter-data-in-power-bi-ce487.jpg\" alt=\"select Paste or manually enter data in Power BI ce487\" width=\"624\" \/><\/a><\/div>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytwYitjZXhwbytQQkk1MzErQ29tcGFyaXNvbis=\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-power-bi.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytncytjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-google-sheets.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZyt4bCtjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-microsoft-excel.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><\/div>\n<ul>\n<li>We&#8217;ll use the <a href=\"https:\/\/chartexpo.com\/blog\/sample-data-for-power-bi\" target=\"_blank\" rel=\"noopener noreferrer\">sample data<\/a> below for this example.<\/li>\n<\/ul>\n<table class=\"static\" style=\"table-layout: fixed; overflow-x: auto; border: 1px; font-size: 17px;\">\n<tbody>\n<tr>\n<td width=\"103\"><strong>Quarters<\/strong><\/td>\n<td width=\"126\"><strong>Vendors<\/strong><\/td>\n<td width=\"154\"><strong>Market Share<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Samsung<\/td>\n<td width=\"154\">27.69<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Apple<\/td>\n<td width=\"154\">28.45<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Xiaomi<\/td>\n<td width=\"154\">11.8<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Huawei<\/td>\n<td width=\"154\">6.53<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Oppo<\/td>\n<td width=\"154\">5.3<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q1<\/td>\n<td width=\"126\">Vivo<\/td>\n<td width=\"154\">4.19<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Samsung<\/td>\n<td width=\"154\">28.14<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Apple<\/td>\n<td width=\"154\">27.58<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Xiaomi<\/td>\n<td width=\"154\">12.62<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Huawei<\/td>\n<td width=\"154\">6.17<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Oppo<\/td>\n<td width=\"154\">5.5<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q2<\/td>\n<td width=\"126\">Vivo<\/td>\n<td width=\"154\">4.21<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Samsung<\/td>\n<td width=\"154\">28.45<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Apple<\/td>\n<td width=\"154\">27.71<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Xiaomi<\/td>\n<td width=\"154\">12.9<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Huawei<\/td>\n<td width=\"154\">6<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Oppo<\/td>\n<td width=\"154\">5.29<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q3<\/td>\n<td width=\"126\">Vivo<\/td>\n<td width=\"154\">4.17<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Samsung<\/td>\n<td width=\"154\">27.97<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Apple<\/td>\n<td width=\"154\">27.62<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Xiaomi<\/td>\n<td width=\"154\">12.68<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Huawei<\/td>\n<td width=\"154\">5.17<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Oppo<\/td>\n<td width=\"154\">6.07<\/td>\n<\/tr>\n<tr>\n<td width=\"103\">Q4<\/td>\n<td width=\"126\">Vivo<\/td>\n<td width=\"154\">4.66<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>Paste the above data table in the Power Query Window.<\/li>\n<li>Select the \u201c<strong>Create a dataset only<\/strong>\u201d option.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/create-a-dataset-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/create-a-dataset-ce508.jpg\" alt=\"Create a dataset ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>On the left-side menu, click \u201c<strong>Data Hub<\/strong>\u201c.<\/li>\n<li>Power BI populates the data set list. (If you have not created a data set, refer to the Error! Reference source not found section).<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-data-hub-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-data-hub-ce508.jpg\" alt=\"Click on Data Hub ce508\" width=\"623\" \/><\/a><\/div>\n<div>\n<ul>\n<li>Click on the \u201c<strong>Create a report<\/strong>\u201d dropdown.<\/li>\n<\/ul>\n<\/div>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/create-a-report-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/create-a-report-ce508.jpg\" alt=\"Create a report ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>Click on Market Share Analysis:<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-market-share-analysis-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-market-share-analysis-ce508.jpg\" alt=\"Click on Market Share Analysis ce508\" width=\"623\" \/><\/a><\/div>\n<div>\n<ul>\n<li>Click the \u201c<strong>Expand All<\/strong>\u201d button.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-expand-all-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-expand-all-ce508.jpg\" alt=\"Click Expand All ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>You can see your chart metrics:<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/chart-metrics-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/chart-metrics-ce508.jpg\" alt=\"chart metrics ce508\" width=\"623\" \/><\/a><\/div>\n<\/div>\n<ul>\n<li>Click on \u201c<strong>Get more visuals<\/strong>&#8220;.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-to-get-more-visuals-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-to-get-more-visuals-ce508.jpg\" alt=\"click on to get more visuals ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>Search for ChartExpo and select the Comparison Bar Chart:<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/02\/comparison-bar-chart-for-power-bi-by-chartexpo-ce487.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/02\/comparison-bar-chart-for-power-bi-by-chartexpo-ce487.jpg\" alt=\"Comparison Bar CHart for Power BI by ChartExpo ce487\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>Click the <strong>\u201cAdd\u201d<\/strong>\u00a0button.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-the-add-button-ce518.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-the-add-button-ce518.jpg\" alt=\"Click the Add button ce518\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>You can now see the Comparison Bar Chart in the visualizations list.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/chart-in-the-visualizations-list-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/chart-in-the-visualizations-list-ce508.jpg\" alt=\"Chart in the visualizations list ce508\" width=\"623\" \/><\/a><\/div>\n<div>\n<ul>\n<li>Expand your chart space.<\/li>\n<\/ul>\n<\/div>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/expand-chart-space-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/expand-chart-space-ce508.jpg\" alt=\"Expand your chart space ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>Select the metrics of your data:<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/select-the-metrics-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/select-the-metrics-ce508.jpg\" alt=\"Select the metrics ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>Click the second icon of Format Visuals and click on Visual:<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-visual-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-on-visual-ce508.jpg\" alt=\"click on Visual ce508\" width=\"623\" \/><\/a><\/div>\n<ul>\n<li>In Visual, click License Settings, add the key, and enable the license.<\/li>\n<li>After adding the key, you can see the comparison bar chart.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-license-settings-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/click-license-settings-ce508.jpg\" alt=\"click License Settings ce508\" width=\"623\" \/><\/a><\/div>\n<div>\n<ul>\n<li>Click the General tab to add the header text.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/add-the-header-text-ce508.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/add-the-header-text-ce508.jpg\" alt=\"add the header text ce508\" width=\"623\" \/><\/a><\/div>\n<\/div>\n<ul>\n<li>The final Comparison Bar Chart in Power BI will appear as below.<\/li>\n<\/ul>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/final-dax-countif.jpg\"><img decoding=\"async\" class=\"alignnone size full wp image 4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/03\/final-dax-countif.jpg\" alt=\"Final DAX COUNTIF\" width=\"623\" \/><\/a><\/div>\n<div style=\"text-align: center;\"><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytwYitjZXhwbytQQkk1MzErQ29tcGFyaXNvbis=\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-power-bi.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZytncytjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-google-sheets.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><a href=\"https:\/\/chartexpo.com\/utmAction\/MTYrYmxvZyt4bCtjZXhwbytDRTUzMSs=\" target=\"_blank&quot;\" rel=\"noopener noreferrer nofollow\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4345\" src=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2023\/04\/CTA-in-microsoft-excel.jpg\" alt=\"\" width=\"205\" height=\"113\" \/><\/a><\/div>\n<h4>Insights<\/h4>\n<ul>\n<li>Samsung leads in market share, securing the top spot, while Apple follows closely in second place.<\/li>\n<li>Xiaomi is on the rise, capturing more market share, while Huawei is experiencing a decline.<\/li>\n<li>Oppo and Vivo have maintained a steady market share.<\/li>\n<li>Notably, there has been a shift between Huawei and Oppo in the last quarter.<\/li>\n<\/ul>\n<h2>FAQs<\/h2>\n<h3>Is there a CONTAINS function in DAX?<\/h3>\n<p>Yes, there is a CONTAINS function in DAX. It is used for substring detection in text fields. The function returns true if a specified substring is found within a given text and false otherwise. It is a valuable tool for data analysis in Power BI and other DAX-supported platforms.<\/p>\n<h3>What is the CONTAINS condition in DAX?<\/h3>\n<p>In DAX, the CONTAINS condition is used for substring detection in text fields. It checks if a specified substring is present within a given text. If the substring is found, the condition evaluates to true; otherwise, it evaluates to false.<\/p>\n<h3>Why is the CONTAINS function important?<\/h3>\n<p>The CONTAINS function is crucial for data analysis in DAX. It enables substring detection, allowing precise filtering and matching. This function is pivotal in enhancing data exploration, improving visualization, and implementing advanced conditional logic. This makes it indispensable for extracting meaningful insights from complex datasets.<\/p>\n<h4 id=\"wrap-up\">Wrap Up<\/h4>\n<p>The significance of the Power BI CONTAINS DAX function in data analysis is unmistakably paramount. It stands as a linchpin, orchestrating a symphony of precision and efficiency in the analytical realm. This function&#8217;s importance extends beyond its seemingly straightforward syntax, transcending into the core of data manipulation and interpretation.<\/p>\n<p>First, the CONTAINS DAX function bestows upon analysts the power of flexible filtering. It allows the extraction of specific data points containing desired substrings. This transforms data exploration into a targeted and streamlined process.<\/p>\n<p>Furthermore, its prowess in substring matching cannot be overstated. It is a digital detective, meticulously searching for patterns and keywords within text fields. Consequently, it unveils critical information that might otherwise remain concealed.<\/p>\n<p>The introduction of advanced conditional logic is another feather in the CONTAINS DAX function&#8217;s cap. It can return true or false values based on substring presence. This facilitates the creation of dynamic analyses, adding a layer of sophistication to decision-making processes.<\/p>\n<p>Additionally, the function enhances data exploration by efficiently guiding you to the information you seek. This allows for a deeper understanding of specific aspects without getting lost in the vast sea of data.<\/p>\n<p>Lastly, CONTAINS DAX contributes to efficient data manipulation, saving time and effort in extracting meaningful insights. Whether isolating data subsets or conducting targeted analyses, the function streamlines the process. This allows you to focus on deriving actionable intelligence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><p>Master art of text analysis with Contains DAX. Discover advanced techniques &#038; strategies to enhance your data exploration &#038; gain valuable insights effortlessly.<\/p>\n&nbsp;&nbsp;<a href=\"https:\/\/chartexpo.com\/blog\/contains-dax\"><\/a><\/p>","protected":false},"author":1,"featured_media":33971,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1017],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>How and When to Use CONTAINS function (DAX)? -<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/chartexpo.com\/blog\/contains-dax\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:title\" content=\"How and When to Use CONTAINS function (DAX)? -\" \/>\r\n<meta name=\"twitter:description\" content=\"Master art of text analysis with Contains DAX. Discover advanced techniques &amp; strategies to enhance your data exploration &amp; gain valuable insights effortlessly.\" \/>\r\n<meta name=\"twitter:image\" content=\"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/feature-ce531-200x200-1.jpg\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How and When to Use CONTAINS function (DAX)? -","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:\/\/chartexpo.com\/blog\/contains-dax","twitter_card":"summary_large_image","twitter_title":"How and When to Use CONTAINS function (DAX)? -","twitter_description":"Master art of text analysis with Contains DAX. Discover advanced techniques & strategies to enhance your data exploration & gain valuable insights effortlessly.","twitter_image":"https:\/\/chartexpo.com\/blog\/wp-content\/uploads\/2024\/04\/feature-ce531-200x200-1.jpg","twitter_misc":{"Written by":"admin","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/chartexpo.com\/blog\/contains-dax","url":"https:\/\/chartexpo.com\/blog\/contains-dax","name":"How and When to Use CONTAINS function (DAX)? -","isPartOf":{"@id":"http:\/\/localhost\/blog\/#website"},"datePublished":"2024-04-17T10:50:30+00:00","dateModified":"2026-01-29T12:10:57+00:00","author":{"@id":"http:\/\/localhost\/blog\/#\/schema\/person\/6aceeb7c948a3f66ff6439ce5c24a280"},"breadcrumb":{"@id":"https:\/\/chartexpo.com\/blog\/contains-dax#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/chartexpo.com\/blog\/contains-dax"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/chartexpo.com\/blog\/contains-dax#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/localhost\/blog"},{"@type":"ListItem","position":2,"name":"How and When to Use CONTAINS function (DAX)?"}]},{"@type":"WebSite","@id":"http:\/\/localhost\/blog\/#website","url":"http:\/\/localhost\/blog\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/localhost\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/localhost\/blog\/#\/schema\/person\/6aceeb7c948a3f66ff6439ce5c24a280","name":"admin","url":"https:\/\/chartexpo.com\/blog\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/posts\/33963"}],"collection":[{"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/comments?post=33963"}],"version-history":[{"count":10,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/posts\/33963\/revisions"}],"predecessor-version":[{"id":58424,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/posts\/33963\/revisions\/58424"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/media\/33971"}],"wp:attachment":[{"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/media?parent=33963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/categories?post=33963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chartexpo.com\/blog\/wp-json\/wp\/v2\/tags?post=33963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}