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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

correlation 2 different table

I 've imported 2 different table, 1 its called project one invoice, 

 

on the invoice table, there is a column called project Id where there is the id of the project, powerbi have created a correlation automatically between project id in invoice table and Id in Project table.

until here all it is good 🙂

 

now I need to create a new column in the invoice table that checks if the column of the month in project table is the same of the column months in invoice table based on correlation of the project id

 

the values in both months column are from 1 to 12

 

anybody can help me? please

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

Hi @Anonymous,

 

Since there existing a relationship between project table and  invoice table, to check if the column of the month in project table is the same of the column months in invoice table based on correlation of the project id, you can add a calculated column in invoice table like below:

Check1 = IF(RELATED(project[Month])=invoice[Month],"Is Same","Not Same")

I need to combine 2  column invoice date and a column project date in the same table format dd/mm/yyyy

 

I need an operation that says me "yes" when the date of the invoice date column  is on the month next compared to the  related project date column

 

Add calculated columns in invoice table:

date in project = RELATED(project[project date])

check2 = IF(DATEDIFF(invoice[date in project],invoice[invoice date],MONTH)=1,"Yes","No")

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Since there existing a relationship between project table and  invoice table, to check if the column of the month in project table is the same of the column months in invoice table based on correlation of the project id, you can add a calculated column in invoice table like below:

Check1 = IF(RELATED(project[Month])=invoice[Month],"Is Same","Not Same")

I need to combine 2  column invoice date and a column project date in the same table format dd/mm/yyyy

 

I need an operation that says me "yes" when the date of the invoice date column  is on the month next compared to the  related project date column

 

Add calculated columns in invoice table:

date in project = RELATED(project[project date])

check2 = IF(DATEDIFF(invoice[date in project],invoice[invoice date],MONTH)=1,"Yes","No")

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

update I made a merge query and it  seems work

 

now I'm  stuck in another way

 

I need to combine 2  column invoice date and a column project date in the same table format dd/mm/yyyy

 

I need an operation that says me "yes" when the date of the invoice date column  is on the month next compared to the  related project date column

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.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.