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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gunther15
Frequent Visitor

Create Hit Rate range with first quoted date and PO Date

Hi I was wondering what logic I need to build in to create a hit rate range for this:

Days to First Order (days between FirstQuotedDate and BrandFirstOrderedDate):
1 - 91: 0 to 3 Months
92 - 182: 3 to 6 Months
183 - 273: 6 to 9 Months
274 - 364: 9 to 12 Months
365+: 12 Months or older

Here is an example of some of the data I have:

gunther15_0-1663679265854.png

 

gunther15_1-1663679297653.png

The PO date is the brand first ordered date in this case.  I was wondering how what logic I need to create that hit rate range from the data I have above.

 

Thank you

 

 

1 REPLY 1
Anonymous
Not applicable

Hi,

 

 I would start with a helper column to get the age

= Table.AddColumn(#"Changed Type1", "Age", each Duration.Days(Date.From([First Quoted Date]) - Date.From([PO Date])))

 

then a column to label the category

= Table.AddColumn(#"Added Age", "Category", each if [Age] < 92 then "0 to 3 Months"
else if [Age] < 183 then "3 to 6 Months"
else if [Age] < 274 then "6 to 9 Months"
else if [Age] < 365 then "9 to 12 Months"
else "12 Months or Older")

 

Whole query below

let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type1" = Table.TransformColumnTypes(Source,{{"PO Date", type date}, {"First Quoted Date", type date}}),
#"Added Age" = Table.AddColumn(#"Changed Type1", "Age", each Duration.Days(Date.From([First Quoted Date]) - Date.From([PO Date]))),
#"Added Category" = Table.AddColumn(#"Added Age", "Category", each if [Age] < 92 then "0 to 3 Months"
else if [Age] < 183 then "3 to 6 Months"
else if [Age] < 274 then "6 to 9 Months"
else if [Age] < 365 then "9 to 12 Months"
else "12 Months or Older")
in
#"Added Category"

 

There probably is a clever way to do it in one step but I'm not that good 🙂 

 

Thanks,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.