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
jayanthan
Helper III
Helper III

No of Days taken to raise PO Calculation

Hi All 

 

When i have below given PR and PO tables , how do i calculate no of days taken to raise PO from PR

 

Table 1  
DatePR IDValue
5/1/2019A100
5/1/2019B80
5/1/2019C60
5/1/2019D50
5/1/2019E100

 

 

Table 2   
PR IDPO IDDateValue
AX5/11/2019100
BX5/11/201980
CY5/16/201960
DZ5/17/201950
EW5/13/201960
ES5/6/201940

 

Regards

Jayanthan

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @jayanthan 

You can add a column to Table2 and use the expresion below.

 

Column = DATEDIFF(RELATED(Table1[Date]), Table2[Date], DAY)

 

Regards,
Mariusz

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

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hi @jayanthan 

You can add a column to Table2 and use the expresion below.

 

Column = DATEDIFF(RELATED(Table1[Date]), Table2[Date], DAY)

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


@Mariusz wrote:

Hi @jayanthan 

You can add a column to Table2 and use the expresion below.

 

Column = DATEDIFF(RELATED(Table1[Date]), Table2[Date], DAY)

 

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




Hi  Mariusz

 

Wow.this is fine thanks, but how can i do this when i have many to many relationship tables . In the below given new example , lets  say PR ID " E" has value in two rows, then how do i it 

 

Table 1  
DatePR IDValue
5/1/2019A100
5/1/2019B80
5/1/2019C60
5/1/2019D50
5/1/2019E60
5/1/2019E40

 

Regards

Jayanthan

Hi @jayanthan 

Can you be a bit more specific in what you are looking to achieve?

Thanks
Mariusz

Hi @Mariusz 

 

How do i calculate no of days taken to raise PO from below example , where PR ID is duplicated in both tables

 

Table 1  
DatePR IDValue
5/1/2019E60
5/1/2019E

40

 

 

 

 

Table 2   
DatePR IDPO IDValue
5/10/2019EX60
5/12/2019EX40

Hi @jayanthan 

You always have to have one side distinct, otherwise you multiplying the outcom.

do you have any other ID's in your table that can create a link between the values?

Many Thanks

Mariusz

Hi Mariusz

 

Yes, i have the line id  which can used to create one to many relationships between tables. it works fine now

 

Thank You so much for the support 

 

Regards

Jayanthan

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.