I have a requirement, where i need to create a calculated column and to identify the first occurrence of a record by monthly basis.
Below is the sample data. The data has duplicates values o a monthly basis.
ID MONTH
AA Jan-01
AA Jan-02
BB Feb-10
BB Feb-20
Expected output:
ID Month out
AA Jan-01 1
AA Jan-02 0
BB Feb-10 1
BB Feb-20 0
Note: If i use powerquery to remove duplicate values, i can achieve this. But i need to achieve this in calculated column.
To solve this you can do the following:
Table.AddColumn(#"Expanded Table (2)", "out", each if [#"AggregatedTable.id"] = null then 0 else 1, type number)