<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Compare data type text columns with measure of single value and if match is exact then 1 else zero in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034461#M159774</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Hi! Can you paste sample data? Thx&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 10:41:44 GMT</pubDate>
    <dc:creator>BeaBF</dc:creator>
    <dc:date>2024-07-10T10:41:44Z</dc:date>
    <item>
      <title>Compare data type text columns with measure of single value and if match is exact then 1 else zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034222#M159751</link>
      <description>&lt;P&gt;Hi Power BI Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying dax query to compare data type text column in physical table with measure(result is single value) and only if the particular row is exact match of measure, then result should be 1 else 0&lt;/P&gt;&lt;P&gt;Below is formula for Scorecard Concatenate which is populating based on slicer&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Scorecard_Concanteate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; Division = [DivisionFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; GEO = [RBUFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; IRIS = [CustomerFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; Ind = [INDFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; Branch = [BranchFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; CTRY = [CountryFiltersSelectedInvoicing]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;SPAN&gt; Division &amp;amp; GEO &amp;amp; CTRY &amp;amp; IRIS &amp;amp; Ind &amp;amp; Branch and below is dax for Scorecard filter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Scorecard Filter = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; [Result],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('DWH FACT_O2C_Scorecard_LIVEDATA', 'DWH FACT_O2C_Scorecard_LIVEDATA'[Concatenate_1] = [Scorecard_Concanteate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Where Result = 1.. Please assist&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 09:13:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034222#M159751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-10T09:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data type text columns with measure of single value and if match is exact then 1 else zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034461#M159774</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Hi! Can you paste sample data? Thx&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 10:41:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034461#M159774</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2024-07-10T10:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data type text columns with measure of single value and if match is exact then 1 else zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034562#M159809</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try using this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;Scorecard_Concatenate =
VAR Division = [DivisionFiltersSelectedInvoicing]
VAR GEO = [RBUFiltersSelectedInvoicing]
VAR IRIS = [CustomerFiltersSelectedInvoicing]
VAR Ind = [INDFiltersSelectedInvoicing]
VAR Branch = [BranchFiltersSelectedInvoicing]
VAR CTRY = [CountryFiltersSelectedInvoicing]
RETURN Division &amp;amp; GEO &amp;amp; CTRY &amp;amp; IRIS &amp;amp; Ind &amp;amp; Branch&lt;/LI-CODE&gt;&lt;LI-CODE lang="java"&gt;Scorecard Filter =
CALCULATE(
    1,
    FILTER(
        'DWH FACT_O2C_Scorecard_LIVEDATA',
        'DWH FACT_O2C_Scorecard_LIVEDATA'[Concatenate_1] = [Scorecard_Concatenate]
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;I&gt;Did I answer your question? Mark this post as a solution if I did!&lt;BR /&gt;Check out this blog of mine:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-Export-Telemetry-Data-from-Azure-IoT-Central-into-Power/m-p/2845191#U2845191" target="_blank" rel="noopener"&gt;How to Export Telemetry Data from Azure IoT Central into Power BI&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 11:58:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4034562#M159809</guid>
      <dc:creator>Shaurya</dc:creator>
      <dc:date>2024-07-10T11:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data type text columns with measure of single value and if match is exact then 1 else zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4036547#M159983</link>
      <description>&lt;P&gt;Hi Shaurya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for trying, when i use your formula below result appears&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;For All rows 1 is appearing but only row in Red should be 1 and rest zero&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202311" data-lia-user-login="BeaBF" class="lia-mention lia-mention-user"&gt;BeaBF&lt;/a&gt;&amp;nbsp;Apologise can't share sample file do to secruity issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 07:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4036547#M159983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-11T07:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data type text columns with measure of single value and if match is exact then 1 else zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4043570#M160374</link>
      <description>&lt;P&gt;Hi,Anonymous&lt;/a&gt;.I am glad to help you.&lt;BR /&gt;Hello, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="450074" data-lia-user-login="Shaurya" class="lia-mention lia-mention-user"&gt;Shaurya&lt;/a&gt;&amp;nbsp;,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202311" data-lia-user-login="BeaBF" class="lia-mention lia-mention-user"&gt;BeaBF&lt;/a&gt;,thanks for your concern about this issue.&lt;/P&gt;
&lt;P&gt;Your answer is excellent!&lt;BR /&gt;And I would like to share some additional solutions below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;According to your description, you want to compare the result of an ordinary column [Concatenate_1] with the value of multiple measure for the value of splicing the measure, if the two values are equal to return 1 otherwise return 0.&lt;BR /&gt;I see that you provide two measure, the following I will analyze the code you provide, if my analysis is correct, you can refer to my suggestions below, if my understanding is wrong, please correct and provide the correct non-sensitive test data or screenshots, thank you.&lt;BR /&gt;1.&lt;BR /&gt;For the following code you provided, I think it is a measure, and the var variables are all measure values, because first of all you provided Scorecard_Concanteate itself is a measure, and for the measure if you directly reference the columns you need to use the aggregation function, but according to the code does not use any aggregation function for the var variables again. But according to the code, there is no aggregation function used for var variables, such as MAX function&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Scorecard_Concanteate =
var Division = [DivisionFiltersSelectedInvoicing]
var GEO = [RBUFiltersSelectedInvoicing]
var IRIS = [CustomerFiltersSelectedInvoicing]
var Ind = [INDFiltersSelectedInvoicing]
 var Branch = [BranchFiltersSelectedInvoicing]
 var CTRY = [CountryFiltersSelectedInvoicing]
 RETURN Division &amp;amp; GEO &amp;amp; CTRY &amp;amp; IRIS &amp;amp; Ind &amp;amp; Branch&lt;/LI-CODE&gt;
&lt;P&gt;2. For your problem: the final result always returns 1&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Scorecard Filter = 
CALCULATE(
    [Result],
    FILTER(
        'DWH FACT_O2C_Scorecard_LIVEDATA',
        'DWH FACT_O2C_Scorecard_LIVEDATA'[Concatenate_1] = [Scorecard_Concanteate] 
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;The measure Scorecard Filter calculates the &lt;STRONG&gt;[Result]&lt;/STRONG&gt; but only for the rows in the ‘DWH FACT_O2C_Scorecard_LIVEDATA’ table where the Concatenate_1 column equals the &lt;STRONG&gt;[Scorecard_Concanteate]&lt;/STRONG&gt; measure.&lt;BR /&gt;&lt;BR /&gt;In fact, the final result of this measure is calculated based on the value of [Result], so if the value of measure[Result] is always 1 in the current context, then the Scorecard Filter will always calculate 1 for each row.&lt;BR /&gt;Here is my test.&lt;BR /&gt;When the value of [Result] is dynamic in the current context, the final result of the Scorecard Filter is also dynamic.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;However, if I set the value of [Result] to a constant value of 1 (which is always 1 in the simulation environment), the final result of the Scorecard Filter will also be 1 for each row.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here is my suggestion.&lt;BR /&gt;I suggest using the IF function directly to make a judgment that the current row's [Concatenate_1] and the current row's MEASURE [Scorecard_Concanteate]&lt;BR /&gt;Compare, if equal, return 1, otherwise return 0&lt;BR /&gt;The current row's value can be retrieved by using the aggregate function in the measure&lt;BR /&gt;like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;M_Scorecard Filter = 
VAR value01=MAX('DWH FACT_O2C_Scorecard_LIVEDATA'[Concatenate_1])
RETURN
IF(value01=[Scorecard_Concanteate],
1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Of course, if your original [Result] itself carries complex filters and calculations, and you want to continue to use the original code, I recommend that you double-check the results of the [Result] calculations, you can show the value of [Result] separately, to see if the value of this measure is the result you expected, and whether its value is changing in the current calculation environment, or always return a constant value of 1 (including the filters inside the code and outside the slicer/filter area/visual itself, which affect the value of measure[result])&lt;/P&gt;
&lt;P&gt;I hope my test will bring you good ideas, and I wish you a speedy solution to your problem!&lt;BR /&gt;&lt;BR /&gt;I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Carson Jian,&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 06:01:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-data-type-text-columns-with-measure-of-single-value-and/m-p/4043570#M160374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-16T06:01:37Z</dc:date>
    </item>
  </channel>
</rss>

