<?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: Assign a maximum value per index in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268709#M169243</link>
    <description>&lt;P&gt;You have not mentioned this calendar table in your post. However, how you are defining dates flaged as T. "Date From" is greater than current date, logic clear to me but How I would you go to another date table to find flag T. That means comparison criteria.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Do you want to count days between "Date From" and "Date To" except those dates flaged as T in calendar table?&lt;BR /&gt;&lt;BR /&gt;Please redefine you complete logic.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2024 07:37:49 GMT</pubDate>
    <dc:creator>shafiz_p</dc:creator>
    <dc:date>2024-11-04T07:37:49Z</dc:date>
    <item>
      <title>Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268168#M169228</link>
      <description>&lt;P&gt;When the 'Index' in the 'Fact' table has a 'data from' later than today's date, then take the last 'value' from the 'Rev' table assigned to that index and multiply this value by the number of days that occur between 'Data from' and 'Data to'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pbix&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1BP1IknHOaf8PCym-sLHHkjYeN1g1S6um/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1BP1IknHOaf8PCym-sLHHkjYeN1g1S6um/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2024 19:12:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268168#M169228</guid>
      <dc:creator>Kris48</dc:creator>
      <dc:date>2024-11-03T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268444#M169234</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="776716" data-lia-user-login="Kris48" class="lia-mention lia-mention-user"&gt;Kris48&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I tried to open your .pbix file, but I wasn't able to open it.&lt;/P&gt;
&lt;P&gt;Just from your screenshot I don't fully know what data is in your table.&lt;/P&gt;
&lt;P&gt;There are a lot of column names that do not appear in your DAX code.&lt;/P&gt;
&lt;P&gt;Please provide the relevant example data if you can or use Dropbox for the .pbix file upload.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 03:01:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268444#M169234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-04T03:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268546#M169238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="776716" data-lia-user-login="Kris48" class="lia-mention lia-mention-user"&gt;Kris48&lt;/a&gt;&amp;nbsp; Considering you want to achieve, If data from is later than today's date , then take the last value from the rev table assigned to that index and multiply by dates between. Try revise your measure by the code below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Value_measure = 
VAR CurrentDate = TODAY()
VAR FilteredFact = 
    FILTER(
        'Fact',
        'Fact'[Data from] &amp;gt; CurrentDate
    )
VAR LastRevValue = 
    CALCULATE(
        LASTNONBLANKVALUE('Rev'[Date], SUM('Rev'[Value])),
        TREATAS(VALUES('Fact'[INDEX]), 'Rev'[INDEX])
    )
VAR DaysBetween = 
    SUMX(
        FilteredFact,
        DATEDIFF('Fact'[Data from], 'Fact'[Data to], DAY)+1
    )
RETURN
    LastRevValue * DaysBetween&lt;/LI-CODE&gt;&lt;P&gt;Output I have :&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;Hope this helps!!&lt;/P&gt;&lt;P&gt;If this solved your problem, please accept it as a solution and kudos!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shahariar Hafiz&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 05:03:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268546#M169238</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-11-04T05:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268681#M169241</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 06:57:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268681#M169241</guid>
      <dc:creator>Kris48</dc:creator>
      <dc:date>2024-11-04T06:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268709#M169243</link>
      <description>&lt;P&gt;You have not mentioned this calendar table in your post. However, how you are defining dates flaged as T. "Date From" is greater than current date, logic clear to me but How I would you go to another date table to find flag T. That means comparison criteria.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Do you want to count days between "Date From" and "Date To" except those dates flaged as T in calendar table?&lt;BR /&gt;&lt;BR /&gt;Please redefine you complete logic.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 07:37:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268709#M169243</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-11-04T07:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268723#M169244</link>
      <description>&lt;P&gt;Yes, I'm sorry I didn't include this in the logic earlier.&amp;nbsp;So the logic is as before. Your dax works, but I would like to add logic to exclude days that have the "T" flag on the calendar&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 07:40:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4268723#M169244</guid>
      <dc:creator>Kris48</dc:creator>
      <dc:date>2024-11-04T07:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4270585#M169354</link>
      <description>&lt;P&gt;Should I start a separate post for my logic? Will it be possible to solve my problem in this thread?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 11:21:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4270585#M169354</guid>
      <dc:creator>Kris48</dc:creator>
      <dc:date>2024-11-05T11:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4270737#M169361</link>
      <description>&lt;P&gt;Do you want to count day between "Date from' and "Date to" excluding the Date Flagged as T. Meaning how you want to consider? What the logic behind this?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 12:58:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4270737#M169361</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-11-05T12:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a maximum value per index</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4271094#M169394</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Yes, I'm sorry I didn't include this in the logic earlier.&amp;nbsp;So the logic is as before. Your dax works, but I would like to add logic to exclude days that have the "T" flag on the calendar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 17:01:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assign-a-maximum-value-per-index/m-p/4271094#M169394</guid>
      <dc:creator>Kris48</dc:creator>
      <dc:date>2024-11-05T17:01:32Z</dc:date>
    </item>
  </channel>
</rss>

