Forum Discussion
Krishna_R
3 years agoNew Member
Date Bins
Hi All, I'm looking to create a simple table which will give me modified records in the following format of bins. But, I'm afraid is there a way to create such date bins. If yes, could anyone sha...
BA_Pete
3 years agoSuper User
Hi Krishna_R ,
In Power Query you would add a conditional column based on the column (presumably a date) that defines the bins, then group on this new column.
Example:
if [Date] = Date.AddDays(Date.From(DateTime.LocalNow()), - 1) then "Yesterday"
else if [Date] >= Date.AddDays(Date.From(DateTime.LocalNow()), - 7) then "7 - 2"
else if [Date] >= Date.AddDays(Date.From(DateTime.LocalNow()), - 30) then "30 - 8"
... etc.
Then Group By this new column and add a Count aggregated column.
Pete