<?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 Get First Non Zero Value of current year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3839521#M150108</link>
    <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;Thank you for your reply, here is the sample table. There is no termination date, each row stand for an active employee as of month end. The effective date column has relationship with DimDate table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to get the employee amount as of last year end, however there was no Japan employee as&amp;nbsp;of 12/31/2023, so I want a DAX to show the next month data when the amount is greater than 0, which is 2, as of 1/31/2024.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When user select 2/29/2024 as the effective date, or any future date this year, ideally the [&lt;STRONG&gt;Begin Amount]&lt;/STRONG&gt; for Japan should always be 2 (&lt;SPAN&gt;as of 1/31/2024).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried &lt;STRONG&gt;[Begin Amount] =&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, (&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTNONBLANKVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DimDate'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;STRONG&gt;[Employee of Current Month]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)),&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;) but it returns 3 for Japan employee amount, that is as of 2/29/2024 (the selected effective date).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 02:48:36 GMT</pubDate>
    <dc:creator>Lexi_Liu</dc:creator>
    <dc:date>2024-04-16T02:48:36Z</dc:date>
    <item>
      <title>How to Get First Non Zero Value of current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3837831#M150035</link>
      <description>&lt;P&gt;Is there a way to get the first non zero value of current year? I tried &lt;STRONG&gt;&lt;U&gt;Firstnonblank&lt;/U&gt;&lt;/STRONG&gt; but it only returns selected month data.&lt;/P&gt;&lt;P&gt;My Fact Table 'Employee' contains [Effective Date] and [employee ID], each row stands for an employee. The effective dates are end day of each month.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a Date slicer, contains each month end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Employee of Current Month]&lt;/STRONG&gt; =&amp;nbsp;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TOTALMTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;countrows&lt;/SPAN&gt;&lt;SPAN&gt;('Employee'),'Date'[Date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt; =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Employee of Current Month]&lt;/SPAN&gt;&lt;SPAN&gt;, ENDOFYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PREVIOUSYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;Now I want to use DAX to create a condition, if the&amp;nbsp;&lt;STRONG&gt;[Last Year End Employee]= 0&lt;/STRONG&gt;, then return the first month's value that the number of employee is greater than 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 10:04:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3837831#M150035</guid>
      <dc:creator>Lexi_Liu</dc:creator>
      <dc:date>2024-04-15T10:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get First Non Zero Value of current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3838312#M150049</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="551102" data-lia-user-login="Lexi_Liu" class="lia-mention lia-mention-user"&gt;Lexi_Liu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the Employee only appear once in the table or is there an entry for each month for the Employee? Can you explain in more detail in what you want to exactly acheive? Are you trying to get current employee amount and last years amount? Is there a termination date also? If you can, please provide a sample of the table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 12:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3838312#M150049</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-04-15T12:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get First Non Zero Value of current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3839521#M150108</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;Thank you for your reply, here is the sample table. There is no termination date, each row stand for an active employee as of month end. The effective date column has relationship with DimDate table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to get the employee amount as of last year end, however there was no Japan employee as&amp;nbsp;of 12/31/2023, so I want a DAX to show the next month data when the amount is greater than 0, which is 2, as of 1/31/2024.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When user select 2/29/2024 as the effective date, or any future date this year, ideally the [&lt;STRONG&gt;Begin Amount]&lt;/STRONG&gt; for Japan should always be 2 (&lt;SPAN&gt;as of 1/31/2024).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried &lt;STRONG&gt;[Begin Amount] =&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, (&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTNONBLANKVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DimDate'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;STRONG&gt;[Employee of Current Month]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)),&lt;STRONG&gt;[Last Year End Employee]&lt;/STRONG&gt;) but it returns 3 for Japan employee amount, that is as of 2/29/2024 (the selected effective date).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 02:48:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3839521#M150108</guid>
      <dc:creator>Lexi_Liu</dc:creator>
      <dc:date>2024-04-16T02:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get First Non Zero Value of current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3840004#M150121</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="551102" data-lia-user-login="Lexi_Liu" class="lia-mention lia-mention-user"&gt;Lexi_Liu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you are overthinking here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure as base measure to count Employees&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Employee = DISTINCTCOUNT(Employee[Employee ID])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When you add this alone to a Matrix, this will show all the month/years where there is an employee active.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;You can also create measures to calculate This year's and last year's numbers&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Employee YTD = TOTALYTD([Employee], 'DIM Date Test'[Date])&lt;/LI-CODE&gt;&lt;P&gt;YTD&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;PY&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Employee PY = 
CALCULATE ( [Employee], DATEADD ( 'DIM Date Test'[Date], -1, YEAR ) )&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you found my answer helpful and it solved your issue, please accept as solution&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 05:27:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3840004#M150121</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-04-16T05:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get First Non Zero Value of current year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3840075#M150125</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;Thanks for your detailed solution.&lt;/P&gt;&lt;P&gt;The reason we need Begin amount is because when calculating the average amount, the ending amount is as of the selected month end, and the begin amount, usually it's the last year end amount, unless it's 0, then we should use the first non-zero amount as begin amount.&lt;/P&gt;&lt;P&gt;So I'm thinking if there is a way to achieve this.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 05:56:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-First-Non-Zero-Value-of-current-year/m-p/3840075#M150125</guid>
      <dc:creator>Lexi_Liu</dc:creator>
      <dc:date>2024-04-16T05:56:53Z</dc:date>
    </item>
  </channel>
</rss>

