Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Krishna_R
New 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 share the relevant article/approach to sort this.

 

Last ModifiedCount
>30 days 5
30-152
7 - 23
Yesterday1
1 REPLY 1
BA_Pete
Super User
Super 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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.