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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ny326n
Frequent Visitor

Create a match in two tables based on previous and current month

Hi everyone!

 

I have two tables, one with the creation date of client accounts:

Client ID, Creation date

 

The second table includes created assignements:

Client ID, Assignment ID, Assignment creation date

 

What I want to do is to calculate the percentage of clients who created their account in previous month who placed an assignment in current month. I also want to calculate the average time from account registration to first creation of assignment.

 

Anyone got any suggestions on how to solve this?

 

Thank you very much in advance!

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @ny326n,

First, please create a relationship between the table.

Second, in second table, you create a calculated column using RELATED function as the following formula.

create-date=RELATED(Table1[Creation date])


Third, create another calculated column using the formula, which shows if the account was created in previous month.

flag=IF(MONTH(Assignment creation date)-MONTH(create-date)>=1,"Yes","No")


Create a measure to calculate the percentage of clients who created their account in previous month who placed an assignment in current month.

Percentage=CALCULATE(DISTINCTCOUNT(Table2[ClientID]),FILTER(Table2,Table[flag]="Yes"))/CALCULATE(DISTINCTCOUNT(Table2[ClientID]),ALL(Table2))


>>I also want to calculate the average time from account registration to first creation of assignment.

Create a calculated to get the difference using the formula.

difference=Table2[create-date]-Table2[Assignment creation date]

Create a measure using the formula.

Average=AVERAGE(Table2[difference])


Best Regards,
Aneglia





View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @ny326n,

First, please create a relationship between the table.

Second, in second table, you create a calculated column using RELATED function as the following formula.

create-date=RELATED(Table1[Creation date])


Third, create another calculated column using the formula, which shows if the account was created in previous month.

flag=IF(MONTH(Assignment creation date)-MONTH(create-date)>=1,"Yes","No")


Create a measure to calculate the percentage of clients who created their account in previous month who placed an assignment in current month.

Percentage=CALCULATE(DISTINCTCOUNT(Table2[ClientID]),FILTER(Table2,Table[flag]="Yes"))/CALCULATE(DISTINCTCOUNT(Table2[ClientID]),ALL(Table2))


>>I also want to calculate the average time from account registration to first creation of assignment.

Create a calculated to get the difference using the formula.

difference=Table2[create-date]-Table2[Assignment creation date]

Create a measure using the formula.

Average=AVERAGE(Table2[difference])


Best Regards,
Aneglia





Thank you for your help! It worked perfectly! 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.