<?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: Return/generate value based on date range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3033248#M103774</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419996" data-lia-user-login="MoCPA" class="lia-mention lia-mention-user"&gt;MoCPA&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to inactive or remove the relationship between the input table and calendar table. Then create a measure to filter your visual.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Filter = 
VAR _START =
    SELECTEDVALUE ( 'Data Input'[Start Date] )
VAR _END =
    SELECTEDVALUE ( 'Data Input'[End Date] )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) &amp;gt;= _START
            &amp;amp;&amp;amp; MAX ( 'Calendar'[Date] ) &amp;lt;= _END,
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;Add this measure into visual level filter and set it to show items when value = 1. Result is a below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 07:34:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-20T07:34:47Z</dc:date>
    <item>
      <title>Return/generate value based on date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3032162#M103681</link>
      <description>&lt;P&gt;Hello Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to right a measure that generate value based on date range. So basically i've calendar table and data input table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Input&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Start Date&lt;/TD&gt;&lt;TD&gt;End Date&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/1/2020&lt;/TD&gt;&lt;TD&gt;12/31/2021&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the requirement is to put this on line chart that has periods from calendar table on x axes and we want a line shows the amount the Amount on every month within that period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas other that building a table to spread the amounts of rows?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 17:41:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3032162#M103681</guid>
      <dc:creator>MoCPA</dc:creator>
      <dc:date>2023-01-19T17:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Return/generate value based on date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3032828#M103753</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419996" data-lia-user-login="MoCPA" class="lia-mention lia-mention-user"&gt;MoCPA&lt;/a&gt; , Refer if these approches can help&lt;/P&gt;
&lt;P&gt;Measure way&lt;BR /&gt;Power BI Dax Measure- Allocate data between Range: &lt;A href="https://youtu.be/O653vwLTUzM" target="_blank"&gt;https://youtu.be/O653vwLTUzM&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Tables way&lt;BR /&gt;&lt;A href="https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b" target="_blank"&gt;https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2" target="_blank"&gt;https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2&lt;/A&gt;&lt;/P&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>Fri, 20 Jan 2023 02:39:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3032828#M103753</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-20T02:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Return/generate value based on date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3033248#M103774</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419996" data-lia-user-login="MoCPA" class="lia-mention lia-mention-user"&gt;MoCPA&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to inactive or remove the relationship between the input table and calendar table. Then create a measure to filter your visual.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Filter = 
VAR _START =
    SELECTEDVALUE ( 'Data Input'[Start Date] )
VAR _END =
    SELECTEDVALUE ( 'Data Input'[End Date] )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) &amp;gt;= _START
            &amp;amp;&amp;amp; MAX ( 'Calendar'[Date] ) &amp;lt;= _END,
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;Add this measure into visual level filter and set it to show items when value = 1. Result is a below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 07:34:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-generate-value-based-on-date-range/m-p/3033248#M103774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-20T07:34:47Z</dc:date>
    </item>
  </channel>
</rss>

