cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper II

## Find Donor IDs who contributed this year and last year

Problem Statement:  I want to determine how many of the donors that have contributed in the current selected year ( slicer ) also contributed in the prior year.  E.G., if I have 50 unique donor IDs that have contributed in the current year, how many of those IDs also contributed in the prior year where the amount must be greater than \$0.00 in both years.  Donors can donate more than once in a year so there can/will be multiple entries with the same donor ID.

Table(s): I have a single donor table which has the Donor ID, Contribution Date, Amount, and other fields not pertinent to this problem.  I also have a date table

In my visual I will have a slicer where the user will select the "reporting year."  I will have a card which shows the distinct count of donor IDs during that year.  The second card that I want to display would be either the count or percentage of those donor IDs which also contributed in the prior year.

E.G.  50 distinct donor IDs contributed in fiscal year 2023 (card 1).  How many, or what percentage, of those 50 also contributed in fiscal year 2022? (Card 2)

Appreciative of any assistance.

1 ACCEPTED SOLUTION
Helper II

I found exactly what I was looking for at How To Compare Two Table Of Calculated Data Virtually in Power BI (enterprisedna.co).  Kudos to Enterprise DNA.

My report page used that information to produce the 3 bottom cards.

4 REPLIES 4
Helper II

I found exactly what I was looking for at How To Compare Two Table Of Calculated Data Virtually in Power BI (enterprisedna.co).  Kudos to Enterprise DNA.

My report page used that information to produce the 3 bottom cards.

Super User

You can make this a Matrix and add Donor ID (my example shows storename)

Super User

My example model has Time Intelligence by selecting the Date table as Date Table and DateKey as the date column. Sales is a fact table.

Net Sales = sum(Sales[SalesAmount])
LP Net Sales = CALCULATE( [Net Sales], SAMEPERIODLASTYEAR('Date'[Datekey]))
LP Flag = SWITCH( true, [LP Net Sales] > 0, "Y", "N")

Helper II

thanks very much for the input.  I think the difficulty is that there is a subset of IDs (say in 2023) from the donor table and out of those IDs I need to discover which ones also contributed in 2022. It could be all of them or a partial number of them.  While the count of distinct donor IDs is pertinent to the visual, it is the list of those distinct IDs that needs to be found against the donations from last (prior) year.

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors