<?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: Counting Days in a column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2882934#M93372</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465777" data-lia-user-login="phjz" class="lia-mention lia-mention-user"&gt;phjz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;please try :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Number of days = 
VAR basedate = CALCULATE(MIN(Table1[Date]),ALLEXCEPT(Table1,Table1[Product]))
return
DATEDIFF(basedate,SELECTEDVALUE(Table1[Date]),DAY) +1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 13:05:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-03T13:05:49Z</dc:date>
    <item>
      <title>Counting Days in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2882852#M93362</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its really hard to explain, so I'll try to show you what I want within the following table. What I want is a formula for the column "Number of Days".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the table doesn't has values for every date, the formula for "Number of Days" has to refer to a calendar-table (I guess...), which is already created. Otherwise, you could say, that the date of the first apperance of a product could get the day number 1, but then I don't know how to do count the days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t;P&gt;Thank you very much in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 12:58:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2882852#M93362</guid>
      <dc:creator>phjz</dc:creator>
      <dc:date>2022-11-03T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Days in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2882934#M93372</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465777" data-lia-user-login="phjz" class="lia-mention lia-mention-user"&gt;phjz&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;please try :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Number of days = 
VAR basedate = CALCULATE(MIN(Table1[Date]),ALLEXCEPT(Table1,Table1[Product]))
return
DATEDIFF(basedate,SELECTEDVALUE(Table1[Date]),DAY) +1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 13:05:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2882934#M93372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-03T13:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Days in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2883105#M93384</link>
      <description>&lt;P&gt;That does work really good - thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is one last problem with this: I want to compare Product A and B using a line diagram, but I can't put the measure on the x-axis. When I try to type the formula in the field for a new column, it doesn't work. Do you have an idea for this?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 14:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2883105#M93384</guid>
      <dc:creator>phjz</dc:creator>
      <dc:date>2022-11-03T14:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Days in a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2903400#M94629</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465777" data-lia-user-login="phjz" class="lia-mention lia-mention-user"&gt;phjz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't apply a measure to the x-axis of line chart.&lt;/P&gt;
&lt;P&gt;You need to convert your original measure formula to calculated column formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column_Number of days =
VAR basedate =
    CALCULATE ( MIN ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Product] ) )
RETURN
    DATEDIFF ( basedate, Table1[Date], DAY ) + 1
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 10:13:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Days-in-a-column/m-p/2903400#M94629</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-11-14T10:13:47Z</dc:date>
    </item>
  </channel>
</rss>

