Forum Discussion
Taking the min with condition
- 7 years ago
Hi,
Write this calculated column formula in Table1. You will need to change the Table and column names
=CALCULATE(MIN(Table2[Date]),FILTER(Table2,Table2[ID]=EARLIER(Table1[ID])&&Table2[Date]>EARLIER(Table1[Date])))
Hope this helps.
Hi,
I cannot figure out the mistake there. Share the link from where i can download the PBI file with my formula already written there. I will try to correct for the error.
Thank you for your help.
Here is the link: http://35.188.212.139/test_measure.pbix
- Ashish_Mathur7 years ago
Super User
Hi,
Edit the "Cross filter direction" in both relationships to Single. My calulcated column formula will give the correct result.
- Anonymous7 years agoNot applicable
could you send me the working PBIX? I still have an error stating "EARLIER/EARLIEST refers to an earlier row context which doesn't exist". I'm not sure that Filter() can call multiple tables.
- Ashish_Mathur7 years ago
Super User
Hi,
You get that error because you are writing that as a measure. As clearly stated in my previous message, please write your formula as a calculated column formula. Change the Direction of both relationships from Both to Single. Here is a screenshot of the result.