<?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: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/3000049#M101237</link>
    <description>&lt;P&gt;Thank you dear, but the below solution was easier for me, thank you for your reply and support&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2023 05:53:02 GMT</pubDate>
    <dc:creator>NawilatiMahmoud</dc:creator>
    <dc:date>2023-01-04T05:53:02Z</dc:date>
    <item>
      <title>How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997283#M101054</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help in&amp;nbsp;Writing a New Measure to Split/divide/distribute the member premium when it filtered by Date ' Date Table,&lt;/P&gt;&lt;P&gt;the issues is when i filter by the date table it calculte the sum with all amounts based only on the member effcitive date, which is wrong in my example, as I need the DAX in the measure to distribute&amp;nbsp;member premium equaly by days based on the filter duration that i will use , below youll find a screenshot of my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note : I may need a soulation in measurment calculation not in Power Querry as my data is very huge and i can not split it per daye for all records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Member Effective Date&lt;/TD&gt;&lt;TD&gt;Member Ineffective Date&lt;/TD&gt;&lt;TD&gt;Member Premium&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;246.51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;246.51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;210.718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;210.718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;210.718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;210.718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;04/07/2022&lt;/TD&gt;&lt;TD&gt;210.718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;30/09/2022&lt;/TD&gt;&lt;TD&gt;364.405&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;30/09/2022&lt;/TD&gt;&lt;TD&gt;364.405&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;30/09/2022&lt;/TD&gt;&lt;TD&gt;364.405&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;30/09/2022&lt;/TD&gt;&lt;TD&gt;364.405&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;01/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;30/09/2022&lt;/TD&gt;&lt;TD&gt;311.496&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 02 Jan 2023 21:59:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997283#M101054</guid>
      <dc:creator>NawilatiMahmoud</dc:creator>
      <dc:date>2023-01-02T21:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997297#M101055</link>
      <description>&lt;P&gt;Another Note : the&amp;nbsp;&lt;SPAN&gt;distribute&amp;nbsp;member premium should be calculated btween the duration of the start and end date, as if i filter the date more than the end date for any members he will be excluded, and if i start my date filter before the start end, the measure should calculate only the days that incloded in the filter.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 22:16:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997297#M101055</guid>
      <dc:creator>NawilatiMahmoud</dc:creator>
      <dc:date>2023-01-02T22:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997375#M101060</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493366" data-lia-user-login="NawilatiMahmoud" class="lia-mention lia-mention-user"&gt;NawilatiMahmoud&lt;/a&gt; , refer if this 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;</description>
      <pubDate>Tue, 03 Jan 2023 01:20:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2997375#M101060</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-03T01:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2998136#M101105</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="493366" data-lia-user-login="NawilatiMahmoud" class="lia-mention lia-mention-user"&gt;NawilatiMahmoud&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Column:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total = 
CALCULATE ( SUM ( 'Table'[Member Premium] ),
    ALLEXCEPT ( 'Table',
        'Table'[Member Effective Date],
        'Table'[Member Ineffective Date]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Maxdate = IF(MAX('Date'[Date])&amp;lt;=SELECTEDVALUE('Table'[Member Ineffective Date]),MAX('Date'[Date]),SELECTEDVALUE('Table'[Member Ineffective Date]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Mindate = IF(MIN('Date'[Date])&amp;lt;=SELECTEDVALUE('Table'[Member Effective Date]),SELECTEDVALUE('Table'[Member Effective Date]),MIN('Date'[Date]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
Var _datediff=DATEDIFF([Mindate],[Maxdate],DAY)
Return
DIVIDE(SUM('Table'[Total]),_datediff)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 09:13:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/2998136#M101105</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-01-03T09:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/3000045#M101236</link>
      <description>&lt;P&gt;Thank Dear. Amitchandaj,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it solve my issue correctly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 05:51:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/3000045#M101236</guid>
      <dc:creator>NawilatiMahmoud</dc:creator>
      <dc:date>2023-01-04T05:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: How To Write a New Measure to Split/divide/distribute a value when it filtered by Date ' Date Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/3000049#M101237</link>
      <description>&lt;P&gt;Thank you dear, but the below solution was easier for me, thank you for your reply and support&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 05:53:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-To-Write-a-New-Measure-to-Split-divide-distribute-a-value/m-p/3000049#M101237</guid>
      <dc:creator>NawilatiMahmoud</dc:creator>
      <dc:date>2023-01-04T05:53:02Z</dc:date>
    </item>
  </channel>
</rss>

