<?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 Trying to make a formula conditional by date depending on time from current date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2627797#M76745</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement the Excel formula in the below screenshots into DAX for use in a Power BI dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my data, the formula, and an explanation of what the formula does:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a date is over 6 days ago, I do not want to adjust its value. If a date is within 6 days of the current date but more than 2 days ago (so 3, 4, 5, or 6 days ago), I want to increase it by 11.5% each day for the number of days remaining until it hits 6 days. If a date was within the past 2 days, I want to increase it by 13% each day for the number of days remaining until it hits 6 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula shown below accomplishes that in Excel.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now trying to port the formula into Power BI. I used a formula identical to the one above, but I replaced DAYS() with DATEDIFF(). However, I get an error when trying to reference the date column, saying that "A single value for column 'Date' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 13:50:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-08T13:50:30Z</dc:date>
    <item>
      <title>Trying to make a formula conditional by date depending on time from current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2627797#M76745</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement the Excel formula in the below screenshots into DAX for use in a Power BI dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my data, the formula, and an explanation of what the formula does:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a date is over 6 days ago, I do not want to adjust its value. If a date is within 6 days of the current date but more than 2 days ago (so 3, 4, 5, or 6 days ago), I want to increase it by 11.5% each day for the number of days remaining until it hits 6 days. If a date was within the past 2 days, I want to increase it by 13% each day for the number of days remaining until it hits 6 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula shown below accomplishes that in Excel.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now trying to port the formula into Power BI. I used a formula identical to the one above, but I replaced DAYS() with DATEDIFF(). However, I get an error when trying to reference the date column, saying that "A single value for column 'Date' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 13:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2627797#M76745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-08T13:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to make a formula conditional by date depending on time from current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628009#M76757</link>
      <description>&lt;P&gt;You should be able to use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATEDIFF( TODAY(), SELECTEDVALUE('Table'[Date]), DAY)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:04:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628009#M76757</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-08T15:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to make a formula conditional by date depending on time from current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628042#M76761</link>
      <description>&lt;P&gt;Thank you for the help. I just tried this and am no longer getting the same error, but it did cause a new issue. The results are instead blank for the new measure in the table I made&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:21:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628042#M76761</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-08T15:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to make a formula conditional by date depending on time from current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628069#M76762</link>
      <description>&lt;P&gt;can you post the full measure definition and maybe a screenshot of the table structure?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:29:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628069#M76762</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-08T15:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to make a formula conditional by date depending on time from current date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628102#M76765</link>
      <description>&lt;P&gt;I just realized the issue; I had missed part of my formula, so the nested IF statement was off. It works now! Thank you so much; I massively appreciate it.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:36:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-make-a-formula-conditional-by-date-depending-on-time/m-p/2628102#M76765</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-08T15:36:43Z</dc:date>
    </item>
  </channel>
</rss>

