<?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 Count Number of Days from Selected year to Last update in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3346065#M125639</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am looking for a solution to count the number of days since the last update date. I have a slicer for years (2020, 2021, 2022, etc.), and when I select the year , I need to calculate the number of days from the last date of the selected year to the last update by Team.&lt;/P&gt;&lt;P&gt;See the sample&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2023 08:43:45 GMT</pubDate>
    <dc:creator>ajisharavind_99</dc:creator>
    <dc:date>2023-07-24T08:43:45Z</dc:date>
    <item>
      <title>Count Number of Days from Selected year to Last update</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3346065#M125639</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am looking for a solution to count the number of days since the last update date. I have a slicer for years (2020, 2021, 2022, etc.), and when I select the year , I need to calculate the number of days from the last date of the selected year to the last update by Team.&lt;/P&gt;&lt;P&gt;See the sample&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 08:43:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3346065#M125639</guid>
      <dc:creator>ajisharavind_99</dc:creator>
      <dc:date>2023-07-24T08:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count Number of Days from Selected year to Last update</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3347166#M125683</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374068" data-lia-user-login="ajisharavind_99" class="lia-mention lia-mention-user"&gt;ajisharavind_99&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Let's assume you have such a calendar table not connected to the main one:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Having that table, you could create such a measure:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In plain text for convenience:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Diff Measure = 
VAR LastUpdate = MIN ( [Last Update] )
VAR MaxDate = MAX ( 'Date'[Date] )
RETURN DATEDIFF ( LastUpdate, MaxDate, DAY ) &lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 18:35:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3347166#M125683</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-07-24T18:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count Number of Days from Selected year to Last update</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3350043#M125791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374068" data-lia-user-login="ajisharavind_99" class="lia-mention lia-mention-user"&gt;ajisharavind_99&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;There is an another solution for you, different with&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518952" data-lia-user-login="barritown" class="lia-mention lia-mention-user"&gt;barritown&lt;/a&gt;&amp;nbsp;, need not create a large date table.&lt;/P&gt;
&lt;P&gt;1. below is my test table&lt;/P&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Year:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. create ameasure with below dax formula&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _year =
    SELECTEDVALUE ( 'Year'[Year] )
VAR _date =
    DATE ( _year, 12, 31 )
VAR lu =
    SELECTEDVALUE ( 'Table'[Last Update] )
RETURN
    IF ( ISFILTERED ( 'Year'[Year] ), ABS ( DATEDIFF ( lu, _date, DAY ) ), "" )
&lt;/LI-CODE&gt;
&lt;P&gt;3. add a slicer with Year field, add a table visual with Table fields and measure&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 03:12:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3350043#M125791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-26T03:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count Number of Days from Selected year to Last update</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3350087#M125794</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518952" data-lia-user-login="barritown" class="lia-mention lia-mention-user"&gt;barritown&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt; I appreciate your prompt reply. You made my day, and both were successful.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 03:37:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Number-of-Days-from-Selected-year-to-Last-update/m-p/3350087#M125794</guid>
      <dc:creator>ajisharavind_99</dc:creator>
      <dc:date>2023-07-26T03:37:33Z</dc:date>
    </item>
  </channel>
</rss>

