The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Solved! Go to Solution.
Hi, @Anonymous ;
If you use column ,you could try it.
Column = IF([Date]= CALCULATE(MIN([Date]),FILTER('Table',[Head Contract No]=EARLIER([Head Contract No]))),[Date],BLANK())
Or
Column=CALCULATE(MIN([Date]),FILTER('Table',[Head Contract No]=EARLIER([Head Contract No])))
IF you want to create a calculate table.
New table = SUMMARIZE('Table',[Name],[Head Contract No],"Date1",CALCULATE(MIN('Table'[Date]),FILTER(ALL('Table'),[Head Contract No]=EARLIER([Head Contract No]))))
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you try below as column or Measure
Hi, @Anonymous ;
If you use column ,you could try it.
Column = IF([Date]= CALCULATE(MIN([Date]),FILTER('Table',[Head Contract No]=EARLIER([Head Contract No]))),[Date],BLANK())
Or
Column=CALCULATE(MIN([Date]),FILTER('Table',[Head Contract No]=EARLIER([Head Contract No])))
IF you want to create a calculate table.
New table = SUMMARIZE('Table',[Name],[Head Contract No],"Date1",CALCULATE(MIN('Table'[Date]),FILTER(ALL('Table'),[Head Contract No]=EARLIER([Head Contract No]))))
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Excellent - thank you!
Hi, @Anonymous ;
You could create a measure.
Measure = CALCULATE(MIN('Table'[Date]),FILTER(ALLSELECTED('Table'),[Head Contract No]=MAX([Head Contract No])))
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Excellent - that works!
If I wanted to use this in a calculated column (so I could then apply it in other calculations for example) is there an easy way to do this? Or would it require a different approach?
@amitchandak Sorry for the delay - example data below:
Name | Head Contract No | Contract No | Date |
Mr. Smith | 100 | 0800 | 01/02/2022 |
Mr. Smith | 100 | 0805 | 01/01/2022 |
Mr. Smith | 101 | 0810 | 01/05/2022 |
Another person | 105 | 1050 | 01/05/2023 |
In this example, I would like the results returned to be:
Mr Smith, 100, 01/01/2022
Mr Smith, 101, 01/05/2022
Another person, 105, 01/05/2023
So my code can figure out the contract no, and then return the highest head contract associated with it - but I need to figure out how to get the date from the most recent contract returned.
It may be something that I could approach from another angle, if so, any advice is welcome.