<?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: Difference in date between two columns in a measure? in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425014#M1136871</link>
    <description>&lt;P&gt;Hi thank you!&amp;nbsp; I'm having trouble recreating that formula, when I get to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECTEDVALUE ( Table[Date1] ), Table[Date2] )&lt;/PRE&gt;&lt;P&gt;It won't let me select the second date2 column.&amp;nbsp; I mean I can put in Date1 fine but when I try to put in Date2 it will only let me put calculations (measures?) and won't let me insert any real column.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this a limation of the SelectedValue function?&amp;nbsp; Any ideas, does this make sense?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Sep 2023 20:40:54 GMT</pubDate>
    <dc:creator>Donny620</dc:creator>
    <dc:date>2023-09-11T20:40:54Z</dc:date>
    <item>
      <title>Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3424762#M1136790</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an Excel version of this that I am trying to duplicate in PBI.&amp;nbsp; I have three date columns Date 1a(stock date), Date1b(different stock date), and Date 2(sell date).&amp;nbsp; I want to use Date 1a stock date over Date 1b stock date, so only use Date 1b if Date 1a is blank.&amp;nbsp; The goal is to subtract them to see a days in inventory and then one more column which just says that if Aging is &amp;gt;540 then make it 540 and less than 5 make it 5.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason the PBI I'm using won't let me create calculated columns (there are many tables which are connected to some sort of data lake, so I think I might not have access , e.g. right clicking on a table says 'new measure', 'select columns', etc but option to create column).&amp;nbsp; I can create measures though. So my question is: is there a way to create measures which outputs an aging in the way as it is given below?&amp;nbsp; Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1a (given)&lt;/TD&gt;&lt;TD&gt;Date 1b (given)&lt;/TD&gt;&lt;TD&gt;Date 2 (given)&lt;/TD&gt;&lt;TD&gt;Date 1 Column (if 1a is blank do 1b, otherwise always look at 1a)&lt;/TD&gt;&lt;TD&gt;Aging (Date 1 Column minus Date 2)&lt;/TD&gt;&lt;TD&gt;Trimmed Aging&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/21/2023&lt;/TD&gt;&lt;TD&gt;5/1/2023&lt;/TD&gt;&lt;TD&gt;4/6/2023&lt;/TD&gt;&lt;TD&gt;6/21/2023&lt;/TD&gt;&lt;TD&gt;-65&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Null&lt;/TD&gt;&lt;TD&gt;11/30/2014&lt;/TD&gt;&lt;TD&gt;6/13/2019&lt;/TD&gt;&lt;TD&gt;11/30/2014&lt;/TD&gt;&lt;TD&gt;1656&lt;/TD&gt;&lt;TD&gt;540&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 11 Sep 2023 16:58:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3424762#M1136790</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-11T16:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3424834#M1136813</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;you can add a measure like this:&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;Trimmed Aging = 
VAR __Date1 = COALESCE ( SELECTEDVALUE ( Table[Date1] ), Table[Date2] )
VAR __Date2 = SELECTEDVALUE ( Table[Date2] )
VAR __Diff = DATEDIFF ( __Date1, __Date2, DAYS )
RETURN
IF ( __Diff &amp;lt; 5, 5, IF ( __Diff &amp;gt; 540, 540, __Diff ) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 17:44:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3424834#M1136813</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-11T17:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425014#M1136871</link>
      <description>&lt;P&gt;Hi thank you!&amp;nbsp; I'm having trouble recreating that formula, when I get to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECTEDVALUE ( Table[Date1] ), Table[Date2] )&lt;/PRE&gt;&lt;P&gt;It won't let me select the second date2 column.&amp;nbsp; I mean I can put in Date1 fine but when I try to put in Date2 it will only let me put calculations (measures?) and won't let me insert any real column.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is this a limation of the SelectedValue function?&amp;nbsp; Any ideas, does this make sense?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 20:40:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425014#M1136871</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-11T20:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425019#M1136873</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;check my formula, it is not DATE1, DATE2, there is a parenthesis in between.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 20:42:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425019#M1136873</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-11T20:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425283#M1136945</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;Thank you again!&amp;nbsp; I'm having trouble duplicating the formula (Do I add another SelectedValue function and change 'Days' to 'Day'?)&amp;nbsp; To make it super simple here are two files one an Excel which gives the&amp;nbsp;&lt;/P&gt;&lt;P&gt;'answer' using the required logic and a pivot table, and one PBI which looks at the Excel and tries a formula like yours.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1rRqD-bkrzi7TG2ioG_VpmeUZd_gM35wc/view?usp=drive_link" target="_blank"&gt;https://drive.google.com/file/d/1rRqD-bkrzi7TG2ioG_VpmeUZd_gM35wc/view?usp=drive_link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/spreadsheets/d/1O33eBH4uqJns0Fz-Ip7_22XXEfYQ9gMd/edit?usp=drive_link&amp;amp;ouid=105617650305009849389&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank"&gt;https://docs.google.com/spreadsheets/d/1O33eBH4uqJns0Fz-Ip7_22XXEfYQ9gMd/edit?usp=drive_link&amp;amp;ouid=105617650305009849389&amp;amp;rtpof=true&amp;amp;sd=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 01:06:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425283#M1136945</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-12T01:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425319#M1136957</link>
      <description>&lt;P&gt;You could always just use the Power Query through the 'Transform Data' Tab, if you had some thing like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp; you could use a custom column to achieve what you want:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if [Date] = null and [Date2] &amp;lt;&amp;gt; null then [Date2] else if [Date] &amp;lt;&amp;gt; null and [Date2] = null then [Date] else if [Date] = null and [Date2] = null then null else List.Max({[Date],[Date2]}) - #duration(0,0,0,(Duration.TotalSeconds([Date]-[Date2]))/2)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Sep 2023 02:00:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425319#M1136957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-12T02:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425326#M1136960</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 02:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3425326#M1136960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-12T02:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3426371#M1137219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;thank you for your answer!&amp;nbsp; Unforuntatly I for some reason can't add columns, only measures (and if I try to go to Transform Data I get "A DirectQuery connection is required").&amp;nbsp; Due to how the PBI is set up within my org. Is this task impossible if I can't create columns?&amp;nbsp; Is there a measure that will work? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 22:05:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3426371#M1137219</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-12T22:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3428575#M1137819</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;Any advice for me here? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 12:55:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3428575#M1137819</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-13T12:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3429052#M1137947</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;see attached, I hope that is what you are looking for, if not then let me know the expected output. Sorry for the delay.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 16:22:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3429052#M1137947</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-13T16:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431826#M1138739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;thank you so much and I'm so sorry but since my real data set is based on a SQL database it won't let me reference the columns in the way you did.&amp;nbsp; I can get the formula to not give me an error if I tweak it as below but the result is not right (e.g. has values much greater than 540, etc.) My columns are stored in 'Fact Inventory'. I had to add the selectedvalue for it to let me select any column in that table (otherwise it only lets me select other measures), even though it may not be correct to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Trimmed Aging = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact Inventory',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; __Date1 = &lt;/SPAN&gt;&lt;SPAN&gt;COALESCE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 1a]), &lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 1b] ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; __Date2 = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 2 (date it leaves inventory)])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; __Diff = &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt; ( __Date1, __Date2, DAY )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( __Diff &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( __Diff &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;540&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;540&lt;/SPAN&gt;&lt;SPAN&gt;, __Diff ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm hoping it's possible to just tweak this? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Please let me know thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Sep 2023 20:40:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431826#M1138739</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-14T20:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431842#M1138744</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;did you look at pbix file with the solution, I used a different approach and you should follow the same.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 20:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431842#M1138744</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-14T20:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431852#M1138747</link>
      <description>&lt;P&gt;Hi I did thank you, that's where I got the formula (I tweaked it) for the measure I copied below.&amp;nbsp; In your file I see a measure called "Trimmed Aging" (below) and I see a calculated column called "days in invnetory trimmed - fixed".&amp;nbsp; Because my data is just a bunch of SQL tables, or perhaps because of access issues, I cannot create any columns, only measures.&amp;nbsp; That's why I was hoping for a measure-only solution.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Do you think this is possible?&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 21:04:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431852#M1138747</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-14T21:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431905#M1138761</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;the measure I gave you is this one, don't know which one you are using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Trimmed Aging = 

    SUMX ( 
        'Data', 
        VAR __Date1 = COALESCE ( Data[Date 1a], Data[Date 1b] )
        VAR __Date2 = Data[Date 2 (date it leaves inventory)] 
        VAR __Diff = DATEDIFF ( __Date1, __Date2, DAY )
        RETURN 
            IF ( __Diff &amp;lt; 5, 5, IF ( __Diff &amp;gt; 540, 540, __Diff ) )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 Sep 2023 22:06:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3431905#M1138761</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-14T22:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3432997#M1139055</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;Agreed, what I mean is that the file I sent was based on sample data, but on my real data I am unable to use this measure as is because I can't reference columns in that measure.&amp;nbsp; If I try to type in Data[Date 1a], it won't come up, it will only show me other measures/calculations.&amp;nbsp; The only way it would let me reference it was with a function like selectedvalue.&amp;nbsp; Does that make sense? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 13:11:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3432997#M1139055</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-15T13:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433025#M1139064</link>
      <description>&lt;P&gt;Can you share what you expression are you using based on what I gave you. You are trying me to guess things here and making things over complicated.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 13:30:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433025#M1139064</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-15T13:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433030#M1139065</link>
      <description>&lt;P&gt;So sorry!&amp;nbsp; See below, where 'Fact Inventory' is the name of the SQL database table.&amp;nbsp; I only added selectedvalue function because otherwise it won't let me insert/find columns like 'Date 1a' (it only 'finds' calculations/measures).&amp;nbsp; Does this help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Trimmed Aging =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact Inventory',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;__Date1 =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;COALESCE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 1a]),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 1b] ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;__Date2 = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;selectedvalue&lt;/SPAN&gt;&lt;SPAN&gt;('Fact Inventory'[Date 2 (date it leaves inventory)])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;__Diff =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;( __Date1, __Date2, DAY )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;( __Diff &amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;( __Diff &amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;540&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;540&lt;/SPAN&gt;&lt;SPAN&gt;, __Diff ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2023 13:37:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433030#M1139065</guid>
      <dc:creator>Donny620</dc:creator>
      <dc:date>2023-09-15T13:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in date between two columns in a measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433180#M1139103</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="574356" data-lia-user-login="Donny620" class="lia-mention lia-mention-user"&gt;Donny620&lt;/a&gt;&amp;nbsp;it doesn't make sense at all, what is your data source? Are you using DQ/Import or Live connection?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 15:39:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Difference-in-date-between-two-columns-in-a-measure/m-p/3433180#M1139103</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2023-09-15T15:39:16Z</dc:date>
    </item>
  </channel>
</rss>

