Forum Discussion
HankScorpio2
Helper I
11 months agoCreate New Column with True False outcome based on date and id
Hi I have a few years worth of consultant metric data. I want to create a custom column that is based on the lowest date of the first occurrence of a consultant id and mark New in the column for...
- 11 months ago
M Code:
NewStep=let a=Table.Group(YourSourceName,"Agent Id",{"MinDate",each List.Min([Interval Start])}) in Table.AddColumn(YourSourceName,"New Starter", each if [Interval Start]<=a{[#"Agent Id"=[Agent Id]]}[Interval Start]+#duration(70,0,0,0) then "New" else "No")
DAX Code:
NewCalculatedColumn=VAR _mindate=CALCULATE(MIN(YourTable[Interval Start]),ALLEXCEPT(YourTable,YourTable[Agent Id])) RETURN IF(YourTable[Interval Start]<=_mindate+70,"New","No")
v-veshwara-msft
Community Support
11 months agoHi HankScorpio2 ,
Thanks for reaching out to Microsoft Fabric Community.
Just wanted to check if the response provided by wdx223_Daniel helped address your requirement. If you still need any further assistance, please let us know.
Thank you wdx223_Daniel and lbendlin for your inputs on this thread.