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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jwessel
Helper II
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
jwessel
Helper II
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.

jwessel_0-1701878221413.png

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

View solution in original post

4 REPLIES 4
jwessel
Helper II
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.

jwessel_0-1701878221413.png

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

3CloudThomas
Super User
Super User

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

3CloudThomas
Super User
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")
 
LastPeriodFlagSalesForYear.png

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.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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