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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Grouping Data by Time Frame

I would like to group data into buckets based off the number of days from which the data is ran.  Here is a sample of what my data looks like.

 

PMT_AMOUNTCHECK_DATE
$10.009/5/2017
$75.002/25/2018
$100.005/7/2018
$200.001/11/2018
$60.003/5/2018
$15.0010/11/2017
$150.0012/12/2017
$25.004/16/2018
$100.004/1/2018
$30.001/16/2018

 

 

What I would like to do is show the data as the following if I ran the data on 8/27/2018.

 

Time FrameCountTotal
90-120 Days1$100.00
121-180 Days2$125.00
181 and greater7$540.00

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

After my research , you can do these follow my steps like below:

Step1:

Add a ran date column

for example:

3.PNG

Step 2:

Add a Time Frame column:

Time Frame = IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>=30&&DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)<=120,"90-120 Days",IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>120&&DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)<=180,"121-180 Days",IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>180,"181 and greater"))) 

9.png

Step 3:

Drag filed Time Frame,PMT_AMOUNT,CHECK_DATE into table visual, and change the aggregate type of filed CHECK_DATE to Count.10.png

 

Result:

11.png

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
abbasabdulla
Frequent Visitor

Hi,

Try the below function as Calculated Column 

let
  daysuntilltoday= (DateTime.Date(DateTime.LocalNow())-[CHECK_DATE]),

 d= Int64.From(daysuntilltoday),

tag= if d >=90 and d <=120 then "90-120 Days" else if d >=121 and d <=180 then "121-180 Days" else
if d >=181 then "181 and greater" else "Another group"

in
  tag

Then group your data using this column

v-lili6-msft
Community Support
Community Support

After my research , you can do these follow my steps like below:

Step1:

Add a ran date column

for example:

3.PNG

Step 2:

Add a Time Frame column:

Time Frame = IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>=30&&DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)<=120,"90-120 Days",IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>120&&DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)<=180,"121-180 Days",IF(DATEDIFF(Table2[CHECK_DATE],Table2[Ran date],DAY)>180,"181 and greater"))) 

9.png

Step 3:

Drag filed Time Frame,PMT_AMOUNT,CHECK_DATE into table visual, and change the aggregate type of filed CHECK_DATE to Count.10.png

 

Result:

11.png

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.