<?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: Using a function returns blank when using another function value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-function-returns-blank-when-using-another-function-value/m-p/2770357#M86223</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442241" data-lia-user-login="stuartcorns" class="lia-mention lia-mention-user"&gt;stuartcorns&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please change you model as soon as possible to a correct one, meaning a &lt;STRONG&gt;star schema&lt;/STRONG&gt;. Your current model is not following Best Practices and therefore you'll very soon have multiple problems (you already have). Please, before you start doing any serious work with PBI, read this:&amp;nbsp;&lt;A href="https://www.bing.com/ck/a?!&amp;amp;&amp;amp;p=253bf6357c89c149JmltdHM9MTY2MzIwMDAwMCZpZ3VpZD0wMzc1MDlhNy1kNjgwLTZhMDEtMWRlMy0xODc5ZDc0YjZiNTgmaW5zaWQ9NTE5MQ&amp;amp;ptn=3&amp;amp;hsh=3&amp;amp;fclid=037509a7-d680-6a01-1de3-1879d74b6b58&amp;amp;u=a1aHR0cHM6Ly9kb2NzLm1pY3Jvc29mdC5jb20vZW4tdXMvcG93ZXItYmkvZ3VpZGFuY2Uvc3Rhci1zY2hlbWE&amp;amp;ntb=1" target="_blank"&gt;Understand star schema and the importance for Power BI … (bing.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you should never filter by a full table, especially by a fact table as this puts a lot of stress on the engine and DAX becomes slow to the point where you're going to get timeouts. The golden rule of DAX is: &lt;STRONG&gt;Never filter a table when you can filter a column&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 12:07:23 GMT</pubDate>
    <dc:creator>daXtreme</dc:creator>
    <dc:date>2022-09-15T12:07:23Z</dc:date>
    <item>
      <title>Using a function returns blank when using another function value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-function-returns-blank-when-using-another-function-value/m-p/2769804#M86179</link>
      <description>&lt;P&gt;Hi, I was wondering if anyone could help - new to the community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some DAX code that should return some student attendance for the previous week. However, I currently have to hard code the previous fiscal week number, when I place the value from the Calendar Dates table (Calculates the previous fiscal week from the current). This my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Previous Week Attendance Measure = 
var _measure =
DIVIDE(
    CALCULATE(
        COUNT('AT_Session_Marks'[Session Mark]), 
        FILTER(AT_Session_Marks, 'AT_Session_Marks'[Absent] = TRUE), 
        FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 1)
    ), 
    CALCULATE(
        COUNT('AT_Session_Marks'[Session Mark]), 
        FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 1)
    ),
    0)
return
IF(ISBLANK(_measure), 0, _measure)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above returns the correct amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Previous Week Attendance Measure = 
var _measure =
DIVIDE(
    CALCULATE(
        COUNT('AT_Session_Marks'[Session Mark]), 
        FILTER(AT_Session_Marks, 'AT_Session_Marks'[Absent] = TRUE), 
        FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 'Calendar Functions'[Previous Fiscal Week])
    ), 
    CALCULATE(
        COUNT('AT_Session_Marks'[Session Mark]), 
        FILTER('AT_Session_Marks', 'AT_Session_Marks'[Fiscal Week No] = 'Calendar Functions'[Previous Fiscal Week])
    ),
    0)
return
IF(ISBLANK(_measure), 0, _measure)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Whereas the above returns 0 despite the 'Calendar Functions'[Previous Fiscal Week] outputting the correct value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate some guidance. TIA&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Sep 2022 09:08:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-function-returns-blank-when-using-another-function-value/m-p/2769804#M86179</guid>
      <dc:creator>stuartcorns</dc:creator>
      <dc:date>2022-09-15T09:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using a function returns blank when using another function value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-function-returns-blank-when-using-another-function-value/m-p/2770357#M86223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442241" data-lia-user-login="stuartcorns" class="lia-mention lia-mention-user"&gt;stuartcorns&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please change you model as soon as possible to a correct one, meaning a &lt;STRONG&gt;star schema&lt;/STRONG&gt;. Your current model is not following Best Practices and therefore you'll very soon have multiple problems (you already have). Please, before you start doing any serious work with PBI, read this:&amp;nbsp;&lt;A href="https://www.bing.com/ck/a?!&amp;amp;&amp;amp;p=253bf6357c89c149JmltdHM9MTY2MzIwMDAwMCZpZ3VpZD0wMzc1MDlhNy1kNjgwLTZhMDEtMWRlMy0xODc5ZDc0YjZiNTgmaW5zaWQ9NTE5MQ&amp;amp;ptn=3&amp;amp;hsh=3&amp;amp;fclid=037509a7-d680-6a01-1de3-1879d74b6b58&amp;amp;u=a1aHR0cHM6Ly9kb2NzLm1pY3Jvc29mdC5jb20vZW4tdXMvcG93ZXItYmkvZ3VpZGFuY2Uvc3Rhci1zY2hlbWE&amp;amp;ntb=1" target="_blank"&gt;Understand star schema and the importance for Power BI … (bing.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you should never filter by a full table, especially by a fact table as this puts a lot of stress on the engine and DAX becomes slow to the point where you're going to get timeouts. The golden rule of DAX is: &lt;STRONG&gt;Never filter a table when you can filter a column&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 12:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-function-returns-blank-when-using-another-function-value/m-p/2770357#M86223</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-09-15T12:07:23Z</dc:date>
    </item>
  </channel>
</rss>

