Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Date relationship with condition

Hi,

 

In my data table there are  separate close dates for opportunities and close dates for quotations.

In power query I combined these close dates into one column

 

"ClosePossibleDate", each if [SalesPhase] = "Opportunity" then [close_date] else if [SalesPhase] = "Quotation" then [date_possible] else null).

 

In the data model Quotations are linked to Opportunities when they have the same id key.

In Power BI I want to present the Close date of a quotions or opportunity when there is no quotation

 

Opportunity - Quotation: Close Date Quotation

Opportunity -  Empty: Close Date Opportunity 

Empty - Quotation: Close Date Quotation

 

As the close dates are linked to both opportunity and quotations the values are presented double.

 

Close Possible Date|          Opp. | Quotation

1-11-2019               Serial O123 | Serial Q123

1-12-2019               Serial O123 | Serial Q123

 

This should be: 

1-12-2019           Serial O123   | Serial Q123

 

 

Thanks

 

 

 

 

 

 

1 Reply

  • Try getting the date from the parent table to child table like this and then develop rest. As a new Column

     

      date from date = CALCULATE(MAX('Order'[Order Date]))