<?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: How to mimic a query's constraints in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868031#M40019</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should work mostly until unless there is a gap between your database and the Power BI dataset. Can you check that?&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 15:32:35 GMT</pubDate>
    <dc:creator>SivaMani</dc:creator>
    <dc:date>2021-05-27T15:32:35Z</dc:date>
    <item>
      <title>How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867847#M40006</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am connected to a live database in PBI via a Dataflow. I use a simple query to give me a count of what I am looking for and need to replicate that in DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT count(IPID) as theSwitches 
FROM KUB.MVIEW_E_SWITCH 
WHERE (NORMALPOSITIONA = 0 OR NORMALPOSITIONB = 0 OR NORMALPOSITIONC = 0) 
AND (FEEDERID &amp;lt;&amp;gt; FEEDERID2) 
AND FEEDERID2 is not null&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on my DAX statement now, I just have it flagged TRUE or FALSE and am just counting the TRUE values in my report section, but it doesn't have to be formatted this way.&amp;nbsp; I cannot get the number of true values to replicate the values from the query when I run it in SQL Developer. Here is my current DAX:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TIE= (MVIEW_E_SWITCH[NORMALPOSITIONA]= 0 || 
MVIEW_E_SWITCH[NORMALPOSITIONB] = 0 || 
MVIEW_E_SWITCH[NORMALPOSITIONC]= 0) 
&amp;amp;&amp;amp; (MVIEW_E_SWITCH[FEEDERID] &amp;lt;&amp;gt; MVIEW_E_SWITCH[FEEDERID2]) 
&amp;amp;&amp;amp; NOT(ISBLANK(MVIEW_E_SWITCH[FEEDERID2]))&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me understand why the count of the two are different?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:21:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867847#M40006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-27T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867893#M40012</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;Try this DAX code in a measure,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count =
CALCULATE (
    COUNT ( MVIEW_E_SWITCH[IPID] ),
    FILTER (
        MVIEW_E_SWITCH,
        ( MVIEW_E_SWITCH[NORMALPOSITIONA] = 0
            || MVIEW_E_SWITCH[NORMALPOSITIONB] = 0
            || MVIEW_E_SWITCH[NORMALPOSITIONC] = 0 )
            &amp;amp;&amp;amp; MVIEW_E_SWITCH[FEEDERID] &amp;lt;&amp;gt; MVIEW_E_SWITCH[FEEDERID2 ]
            &amp;amp;&amp;amp; NOT ISBLANK ( MVIEW_E_SWITCH[FEEDERID2] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:40:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867893#M40012</guid>
      <dc:creator>SivaMani</dc:creator>
      <dc:date>2021-05-27T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867940#M40015</link>
      <description>&lt;P&gt;Thanks for the input Siva! I am getting the same number I was getting when I did a count of all "True" values in my custom column. When I run my query I get a count of 991, but when I do this count i am getting 1442, which is a pretty big difference and I cannot seem to figure out what is wrong with the DAX... Would M Code be better to use for something like that?&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:56:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1867940#M40015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-27T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868031#M40019</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should work mostly until unless there is a gap between your database and the Power BI dataset. Can you check that?&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 15:32:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868031#M40019</guid>
      <dc:creator>SivaMani</dc:creator>
      <dc:date>2021-05-27T15:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868129#M40021</link>
      <description>&lt;P&gt;There does not seem to be a gap. There are 4,947 rows in both the PowerBI dataset and database.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 16:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868129#M40021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-27T16:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to mimic a query's constraints in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868869#M40037</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible, remove sensitive information and Share the pbix file for further analysis.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 03:22:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-mimic-a-query-s-constraints-in-DAX/m-p/1868869#M40037</guid>
      <dc:creator>SivaMani</dc:creator>
      <dc:date>2021-05-28T03:22:34Z</dc:date>
    </item>
  </channel>
</rss>

