<?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: Number of donors by value, through time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3643731#M141091</link>
    <description>&lt;P&gt;I managed to sort out a calculation like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;High Donors = 

CALCULATE (
    [Active Donors],
    FILTER (
        ALL('Donor'),
        CALCULATE (
            SUM('Transaction'[Amount]),
            DATESINPERIOD(
                'Calendar'[Date],
                LASTDATE('Calendar'[Date]),
                -12,
                MONTH
            )
        ) &amp;gt;= 500
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Would you say this is the right approach?&lt;BR /&gt;When I add the three categories as measures to my table it is taking a long time to calculate. Is there a better way to achieve this?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 14:37:00 GMT</pubDate>
    <dc:creator>PBI-Bro</dc:creator>
    <dc:date>2024-01-17T14:37:00Z</dc:date>
    <item>
      <title>Number of donors by value, through time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3643610#M141080</link>
      <description>&lt;P&gt;We need to create a table visualisation to display the following values by year and month (extendable to quarter and week):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Number of active donors&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The Number of active donors split by their category. This category is based on the amount donated over the last 12 months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Donor category is defined as:&amp;nbsp;&lt;/P&gt;&lt;P&gt;0-100 -&amp;gt; low&lt;/P&gt;&lt;P&gt;101 - 500 --&amp;gt; middle&lt;/P&gt;&lt;P&gt;500+ --&amp;gt; high&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end result should look like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Quarter&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Month&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Active Donors&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Low&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Middle&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;High&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;October&lt;/TD&gt;&lt;TD&gt;280&lt;/TD&gt;&lt;TD&gt;180&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;November&lt;/TD&gt;&lt;TD&gt;310&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;December&lt;/TD&gt;&lt;TD&gt;320&lt;/TD&gt;&lt;TD&gt;190&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2024&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;January&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp; In October 2023 received donations from 180 donors who are categorized as "low" because their donations in the previous 12 months amounted to less than USD100.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My model has the tables transaction, donor and calendar. Calendar hat a relationsihp to transaction and is marked as calendar table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can calculate the number of active donors with this measure:&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;Active Donors = 
VAR Result =
    CALCULATE (
        COUNT('Donor'[DonorID]),
        FILTER(
            'Transaction',
             'Transaction'[Status] = "Booked"
             )
    )
RETURN Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am having trouble figuring out how to write measures to calculate the categories.&lt;/STRONG&gt; I can calculate them for a static point in time but not in a way that they take the date categories into account.&amp;nbsp; What should I look into? Thanks fory any help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 13:37:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3643610#M141080</guid>
      <dc:creator>PBI-Bro</dc:creator>
      <dc:date>2024-01-17T13:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Number of donors by value, through time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3643731#M141091</link>
      <description>&lt;P&gt;I managed to sort out a calculation like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;High Donors = 

CALCULATE (
    [Active Donors],
    FILTER (
        ALL('Donor'),
        CALCULATE (
            SUM('Transaction'[Amount]),
            DATESINPERIOD(
                'Calendar'[Date],
                LASTDATE('Calendar'[Date]),
                -12,
                MONTH
            )
        ) &amp;gt;= 500
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Would you say this is the right approach?&lt;BR /&gt;When I add the three categories as measures to my table it is taking a long time to calculate. Is there a better way to achieve this?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:37:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3643731#M141091</guid>
      <dc:creator>PBI-Bro</dc:creator>
      <dc:date>2024-01-17T14:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Number of donors by value, through time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3645311#M141143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="225991" data-lia-user-login="PBI-Bro" class="lia-mention lia-mention-user"&gt;PBI-Bro&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN&gt;Based on your description, you are looking to create a table visualization that displays the number of active donors along with their categories by time period.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;To calculate the donor categories dynamically based on the amount donated over the last 12 months, you'll need to write DAX measures that take into account the time intelligence functions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's another expression based on the MEASUR you created, you can try this MEASURE to see if it improves your computation speed. The rest of the levels of MEASURE you can achieve by changing the scope of the restrictions&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;High Category Donors = 
CALCULATE(
    COUNTROWS(
        VALUES('Donor'[DonorID])
    ),
    FILTER(
        SUMMARIZE(
            'Transaction',
            'Donor'[DonorID],
            "TotalDonation", CALCULATE(SUM('Transaction'[Amount]), 'Transaction'[Status] = "Booked")
        ),
        [TotalDonation] &amp;gt; 500
    ),
    DATESBETWEEN('Calendar'[Date], DATEADD(LASTDATE('Calendar'[Date]), -1, YEAR), LASTDATE('Calendar'[Date]))
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: SegoeUI; font-size: 11.25pt; color: black;"&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: SegoeUI; font-size: 11.25pt; color: black;"&gt;&lt;SPAN&gt;Albert He&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: SegoeUI; font-size: 11.25pt; color: black;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: SegoeUI; font-size: 11.25pt; color: black;"&gt;&lt;SPAN&gt;If this &lt;EM&gt;&lt;STRONG&gt;post&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 08:10:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Number-of-donors-by-value-through-time/m-p/3645311#M141143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-18T08:10:19Z</dc:date>
    </item>
  </channel>
</rss>

