Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PBI-Bro
Advocate II
Advocate II

Number of donors by value, through time

We need to create a table visualisation to display the following values by year and month (extendable to quarter and week):

 

1. Number of active donors 

2. The Number of active donors split by their category. This category is based on the amount donated over the last 12 months.

 

Donor category is defined as: 

0-100 -> low

101 - 500 --> middle

500+ --> high

 

The end result should look like this:

YearQuarterMonthActive DonorsLowMiddleHigh
20234October2801808020
20234November31020010010
20234December3201908050
20241January120902010

 

For example:  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.

 

My model has the tables transaction, donor and calendar. Calendar hat a relationsihp to transaction and is marked as calendar table.

 

I can calculate the number of active donors with this measure:

 

 

Active Donors = 
VAR Result =
    CALCULATE (
        COUNT('Donor'[DonorID]),
        FILTER(
            'Transaction',
             'Transaction'[Status] = "Booked"
             )
    )
RETURN Result

 

 

I am having trouble figuring out how to write measures to calculate the categories. I can calculate them for a static point in time but not in a way that they take the date categories into account.  What should I look into? Thanks fory any help! 

 

 

1 ACCEPTED SOLUTION
PBI-Bro
Advocate II
Advocate II

I managed to sort out a calculation like this:

High Donors = 

CALCULATE (
    [Active Donors],
    FILTER (
        ALL('Donor'),
        CALCULATE (
            SUM('Transaction'[Amount]),
            DATESINPERIOD(
                'Calendar'[Date],
                LASTDATE('Calendar'[Date]),
                -12,
                MONTH
            )
        ) >= 500
    )
)

Would you say this is the right approach?
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?

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @PBI-Bro ,
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. 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.

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

High Category Donors = 
CALCULATE(
    COUNTROWS(
        VALUES('Donor'[DonorID])
    ),
    FILTER(
        SUMMARIZE(
            'Transaction',
            'Donor'[DonorID],
            "TotalDonation", CALCULATE(SUM('Transaction'[Amount]), 'Transaction'[Status] = "Booked")
        ),
        [TotalDonation] > 500
    ),
    DATESBETWEEN('Calendar'[Date], DATEADD(LASTDATE('Calendar'[Date]), -1, YEAR), LASTDATE('Calendar'[Date]))
)

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 


 

PBI-Bro
Advocate II
Advocate II

I managed to sort out a calculation like this:

High Donors = 

CALCULATE (
    [Active Donors],
    FILTER (
        ALL('Donor'),
        CALCULATE (
            SUM('Transaction'[Amount]),
            DATESINPERIOD(
                'Calendar'[Date],
                LASTDATE('Calendar'[Date]),
                -12,
                MONTH
            )
        ) >= 500
    )
)

Would you say this is the right approach?
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?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.