<?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: calculate a measure based on two date columns in the same table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/879151#M7463</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194605" data-lia-user-login="jfgs_2019" class="lia-mention lia-mention-user"&gt;jfgs_2019&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try a new table like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table = 
addcolumns(
UNION(DISTINCT('Table1'[Create date]);DISTINCT('Table1'[Resolution date]));
"create";calculate(countrows('Table1');filter(ALL('Table1');'Table1'[Create date]=selectedvalue([Date]);
"closed";calculate(countrows('Table1');filter(ALL('Table1');'Table1'[Resolution date]=selectedvalue([Date]);
)&lt;/LI-CODE&gt;&lt;P&gt;but I didnt check &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://linkedin.com/in/alekseizhukov" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 17:56:15 GMT</pubDate>
    <dc:creator>az38</dc:creator>
    <dc:date>2019-12-18T17:56:15Z</dc:date>
    <item>
      <title>calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/878938#M7460</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with IT issues with two dates for each record : creation date and resolution date. I need to get a measure that calculates how many are created in a day and another with how many are closed in a day.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I give you an example screenshot of data and how to get the results.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 15:12:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/878938#M7460</guid>
      <dc:creator>jfgs_2019</dc:creator>
      <dc:date>2019-12-18T15:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/879151#M7463</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194605" data-lia-user-login="jfgs_2019" class="lia-mention lia-mention-user"&gt;jfgs_2019&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try a new table like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table = 
addcolumns(
UNION(DISTINCT('Table1'[Create date]);DISTINCT('Table1'[Resolution date]));
"create";calculate(countrows('Table1');filter(ALL('Table1');'Table1'[Create date]=selectedvalue([Date]);
"closed";calculate(countrows('Table1');filter(ALL('Table1');'Table1'[Resolution date]=selectedvalue([Date]);
)&lt;/LI-CODE&gt;&lt;P&gt;but I didnt check &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://linkedin.com/in/alekseizhukov" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 17:56:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/879151#M7463</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-18T17:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880225#M7496</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the answer. But, something I have to do wrong, since it always gets the same result (attached screenshot)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My new table is:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tabla prueba = ADDCOLUMNS(DISTINCT('Todas las incidencias Soporte I'[Fecha creación])&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;;"create";calculate(countrows('Todas las incidencias Soporte I');filter(ALL('Todas las incidencias Soporte I');'Todas las incidencias Soporte I'[Fecha creación]=selectedvalue('Todas las incidencias Soporte I'[Fecha creación])))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;;"closed";calculate(countrows('Todas las incidencias Soporte I');filter(ALL('Todas las incidencias Soporte I');'Todas las incidencias Soporte I'[Fecha resolución]=selectedvalue('Todas las incidencias Soporte I'[Fecha creación]))))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;And the result is:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question...What is the "Date" field of the "selectedvalue" function in the solution you gave? Sorry if the question is a bit silly, but I'm a Power BI newbie.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:35:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880225#M7496</guid>
      <dc:creator>jfgs_2019</dc:creator>
      <dc:date>2019-12-19T14:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880354#M7498</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194605" data-lia-user-login="jfgs_2019" class="lia-mention lia-mention-user"&gt;jfgs_2019&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date inside SELECTEDVALUE is a date in each row&lt;/P&gt;&lt;P&gt;so, i think, its the reason why your statement doesnt work.&lt;/P&gt;&lt;P&gt;you should try&amp;nbsp;&lt;STRONG&gt;selectedvalue([Fecha creación]) &lt;/STRONG&gt;instead of&amp;nbsp;&lt;STRONG&gt;selectedvalue('Todas las incidencias Soporte I'[Fecha creación])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://linkedin.com/in/alekseizhukov" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:10:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880354#M7498</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-19T16:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880417#M7502</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the clarification regarding the "Date" column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've changed "&lt;STRONG&gt;'Todas las incidencias Soporte I'[Fecha creación]&lt;/STRONG&gt;" to "&lt;STRONG&gt;[Fecha creación]&lt;/STRONG&gt;" and I'm sorry to tell you that the solution you say still doesn't work. The error is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;the 'Fecha creación' column is missing or may not be used in this expression.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The statment is:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Thanks again for your patience &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 16:54:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880417#M7502</guid>
      <dc:creator>jfgs_2019</dc:creator>
      <dc:date>2019-12-19T16:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: calculate a measure based on two date columns in the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880442#M7504</link>
      <description>&lt;P&gt;sorry&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194605" data-lia-user-login="jfgs_2019" class="lia-mention lia-mention-user"&gt;jfgs_2019&lt;/a&gt;&amp;nbsp; my bad&lt;/P&gt;&lt;P&gt;try more complex solution&lt;/P&gt;&lt;P&gt;first, create acalendar table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Tabla prueba = DISTINCT('Todas las incidencias Soporte I'[Fecha creación])&lt;/LI-CODE&gt;&lt;P&gt;then in this Tabla prueba create 2 measures:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;create = calculate(countrows('Todas las incidencias Soporte I');filter(ALL('Todas las incidencias Soporte I');'Todas las incidencias Soporte I'[Fecha creación]=selectedvalue('Tabla prueba'[Fecha creación])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;closed = calculate(countrows('Todas las incidencias Soporte I');filter(ALL('Todas las incidencias Soporte I');'Todas las incidencias Soporte I'[Fecha resolución]=selectedvalue('Tabla prueba'[Fecha creación])))&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://linkedin.com/in/alekseizhukov" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 17:28:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-a-measure-based-on-two-date-columns-in-the-same-table/m-p/880442#M7504</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-19T17:28:33Z</dc:date>
    </item>
  </channel>
</rss>

