<?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: Dax formula works on test but I only get blanks on main data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325339#M171719</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469374" data-lia-user-login="GeorgeColl" class="lia-mention lia-mention-user"&gt;GeorgeColl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a test based on your test data model. It works well on myside. I think your issue should be caused by the data model in your real model. I suggest you to try ALLSELECTED() or ALL() FUNCTION.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Policies in Force =
VAR dateMin =
    MIN ( 'Date'[Date] )
VAR dateMax =
    MAX ( 'Date'[Date] ) // Min and maX dates in period
RETURN
    CALCULATE (
        COUNTROWS ( AllPolicies ),
        FILTER (
            ALLSELECTED ( AllPolicies ),
            AllPolicies[Expiry Date] &amp;gt;= dateMin
                &amp;amp;&amp;amp; AllPolicies[Inception Date] &amp;lt;= dateMax
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 07:26:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-12T07:26:43Z</dc:date>
    <item>
      <title>Dax formula works on test but I only get blanks on main data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4324251#M171678</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DAX formula which I want to calculate the number of policies in force during a period (in the below example per year), the formula counts any policy that has been active at any point during that year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my test model the DAX works completely fine and gives the correct results shown below, however when I try to use the measure in my real report I just receive blank values. The test model is a subsection of my data but all these are the same as in the real model, and I believe to be the only relevant parts used in the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use a relationship in the real model then I do get values instead of blanks, but these are incorrect as i need to not filter the dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any direction for me to look at or something that would cause the values to be blank in the real model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Picutres below are of the test model:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:48:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4324251#M171678</guid>
      <dc:creator>GeorgeColl</dc:creator>
      <dc:date>2024-12-11T15:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula works on test but I only get blanks on main data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4324374#M171687</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469374" data-lia-user-login="GeorgeColl" class="lia-mention lia-mention-user"&gt;GeorgeColl&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ensure the relationship between AllPolicies and Date tables is active in the real model. Inactive relationships may cause your measure to return blank and also&amp;nbsp;Confirm that the Date table contains continuous dates without gaps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; are much appreciated!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Dharmendar S&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/in/dharmendar-s-b5b43463/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;LinkedIN&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:18:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4324374#M171687</guid>
      <dc:creator>dharmendars007</dc:creator>
      <dc:date>2024-12-11T17:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula works on test but I only get blanks on main data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325339#M171719</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469374" data-lia-user-login="GeorgeColl" class="lia-mention lia-mention-user"&gt;GeorgeColl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a test based on your test data model. It works well on myside. I think your issue should be caused by the data model in your real model. I suggest you to try ALLSELECTED() or ALL() FUNCTION.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Policies in Force =
VAR dateMin =
    MIN ( 'Date'[Date] )
VAR dateMax =
    MAX ( 'Date'[Date] ) // Min and maX dates in period
RETURN
    CALCULATE (
        COUNTROWS ( AllPolicies ),
        FILTER (
            ALLSELECTED ( AllPolicies ),
            AllPolicies[Expiry Date] &amp;gt;= dateMin
                &amp;amp;&amp;amp; AllPolicies[Inception Date] &amp;lt;= dateMax
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 07:26:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325339#M171719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T07:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula works on test but I only get blanks on main data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325638#M171729</link>
      <description>&lt;P&gt;Hi Rico,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for having a look into this for me and appreciate it was probably very difficult as it's hard to give too much from my primary model due to confidentiality. Unfortunately the above didn't solve my problem so I reverted to dismantling parts of my main model until the formula worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It turns out that I had a many-to-many relationship between two other tables in my model (this hadn't caused any other issues with any other measures, and I'm still not fully sure why the relationship would affect this measure because it isn't connected to the data being used in the measure - if anyone knows I'd be curious to know why!). I've put a picture below to help show this but apologies as I've had to remove the names, but I've highlighted what was an active many-to-many relationship and upon de-activating it, the formula now works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this can be helpful for someone else in future or atleast a good starting point if you have a measure that works otherwise.&amp;nbsp;&lt;/P&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>Thu, 12 Dec 2024 10:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325638#M171729</guid>
      <dc:creator>GeorgeColl</dc:creator>
      <dc:date>2024-12-12T10:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula works on test but I only get blanks on main data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325651#M171730</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="796215" data-lia-user-login="dharmendars007" class="lia-mention lia-mention-user"&gt;dharmendars007&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking a look and your suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked that there were no gaps in the date table, unfortunately in my reports I use multiple relationships between the two tables so I find it easier to have them all inactive and activate them on a case-by-case basis. In this case there's also not an appropriate relationship between the tables as policy length may cause a policy to be active over multiple years, where each date column only holds a single year and if the relationship was active it would filter out some policies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found the solution and have marked it in my other response if you were interested. Thanks again for looking.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 10:19:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-works-on-test-but-I-only-get-blanks-on-main-data/m-p/4325651#M171730</guid>
      <dc:creator>GeorgeColl</dc:creator>
      <dc:date>2024-12-12T10:19:39Z</dc:date>
    </item>
  </channel>
</rss>

