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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
UK_User123456
Resolver I
Resolver I

Second Gift Date

Hi All,

 

I work for a non profit and starting to use power bi and wanted to show the number of donors that have given in FY 2018/19 for the first time and then given again for the second time?

 

as in the example below 

 

Donor 1234 first gave on 12/04/2018 and then in the gift table gave again on 15/05/2018, this would also apply to donor ID 1243. Donor ID 2345 and 3456 would be disregarded as they dont have any second gift.

 

Donor Table   Gift Table   
         
Donor IDFirst Gift Date  Donor IDGift DateGift Date 2Gift Date 3
123412/04/2018   123415/05/201813/01/2019 
234518/06/2018   2345   
345601/02/2018   3456   
124321/08/2018   124313/12/2018 16/01/03/2019

 

Im not too worried about gift 2 and 3, I just dont know how to insert a measure that will check the first gift and then check if the donor who gave the first has then given again. 

After reading through the community I can see that others have used variables and declared them and used the min/max, but im not sure if I am on the right lines?

 

Please let me know if this makes sense?

3 ACCEPTED SOLUTIONS

thanks @MitchM , however, it only return the very last gift date, I need it to be able to show the first gift as well, so as in the example below:

 

Gift Table

Donor ID         First donor date                Second donor date             Third donor date

1234                12/04/2018                       15/05/2018            

2345                 06/04/2018

1111                07/06/2018                        12/06/2018                         21/08/2018

 

The end result would be:

   

Donor ID         First donor date                Second donor date             

1234                12/04/2018                       15/05/2018            

2345                 06/04/2018

1111                07/06/2018                        12/06/2018                         

 

So not matter if the donor had donated 5 times, I would only want to see the first and second donor date if that makes sense?

 

Apologies if im confusing you, its almost there and what you have provided does kind of work, but I wouldnt know where to start to fix it.

               

View solution in original post

It is no suprise that the filtering does not work. The ranking needs another value (In this case FY) to rank against. To do this you can create a new calc. column called FY:

FY = 
VAR FirstMonthofFY = 9
VAR DateYear = YEAR( GiftData2[Reformatted Date] )
VAR DateMonth = MONTH( GiftData2[Reformatted Date] )
RETURN
    IF(
        DateMonth < FirstMonthofFY,
        (DateYear - 1) & "/" & DateYear,
        DateYear & "/" & (DateYear + 1)
    )

I am not sure when your FY starts, so just change the first variable (FirstMonthofFY) in the formula above to adjust the FY range. Once this is done a slight tweak to the Rank formula (below) should finish it off. The two dontation measures do not need to be adjusted.

Gift_Date_Rank = 
    RANKX(
        FILTER(
            GiftData2,
            GiftData2[Donor ID] = EARLIER( GiftData2[Donor ID] ) &&
            GiftData2[FY] = EARLIER( GiftData2[FY] )
        ),
        GiftData2[Reformatted Date],
        ,
        ASC,
        Dense
    )

View solution in original post

Another question and hopefully the last - once I have the campaign id's and how when the donors gave their 1st and 2nd gift, how would I go about doing a count of how many times the campaign id has appeared, so for example

 

In 2019 for Jan - there were 200 donors that donated a gift on campaign id "2", out of the 200 donors that gave on campaign id "2", 100 donors gave their second gift on campaign id "3", and 50 donors gave on campaign "4" and 50 donors never gave a second gift..

 

So its trying to identify out of all the donors that gave their first gift and to which campaign gave again and if it was to a different campaign code or not.

 

Hope that makes sense

 

TIA

View solution in original post

24 REPLIES 24

No worries! Yes, if you wanted to add an extra dimension to the ranking you would need to add it to the Rank calculated column in a similar way I added FY. Just rember that for every subcategory you add to the rank equation is further slicing down your data. You could always add a second rank column (and additional measures) if you want to rank by another subcategory.

Another question and hopefully the last - once I have the campaign id's and how when the donors gave their 1st and 2nd gift, how would I go about doing a count of how many times the campaign id has appeared, so for example

 

In 2019 for Jan - there were 200 donors that donated a gift on campaign id "2", out of the 200 donors that gave on campaign id "2", 100 donors gave their second gift on campaign id "3", and 50 donors gave on campaign "4" and 50 donors never gave a second gift..

 

So its trying to identify out of all the donors that gave their first gift and to which campaign gave again and if it was to a different campaign code or not.

 

Hope that makes sense

 

TIA

holy moly, this would be easier in excel, but im appreciative of all your help

It seems to work with no filters applied, but as soon as I apply a financial year, it then doesnt work.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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