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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JNelson
Helper II
Helper II

Calculating quote ages

Hello,

 

I have a data set with month and count of quotes. I need a measure that will calculate Count the number of quotes that are: current (1 - 4 months); 5 - 7 months old; 8 - 12months old and greater than 12 months old based off today's current month. 

An example of what I want is below. I will then put the measures into a bar chart to see the "age" of the quotes.

 

TIA

 

JNelson_0-1696308821205.png

 

1 ACCEPTED SOLUTION
ChiragGarg2512
Super User
Super User

@JNelson , First create a month bucket[column] where there can be a classification of month partition. 

Ex. Column

Month Bucket =
var _diff = datediff([Date], today(), month) +1
return
Switch(true(),
_diff <=4 , "   1 - 4 Months",
_diff <=7 , "  5 - 7 Months",
_diff <=12 , " 8 - 12 Months",
">12 Months"
)
 
After creating the above column create a measure
sum = Calculate(SUMX(q4, q4[No. of Quotes]), FILTER(ALL(q4), q4[Month Bucket] = SELECTEDVALUE(q4[Month Bucket])))
 
Replace q4 with the table name.
 
ChiragGarg2512_0-1696335872010.png

 

View solution in original post

2 REPLIES 2
ChiragGarg2512
Super User
Super User

@JNelson , First create a month bucket[column] where there can be a classification of month partition. 

Ex. Column

Month Bucket =
var _diff = datediff([Date], today(), month) +1
return
Switch(true(),
_diff <=4 , "   1 - 4 Months",
_diff <=7 , "  5 - 7 Months",
_diff <=12 , " 8 - 12 Months",
">12 Months"
)
 
After creating the above column create a measure
sum = Calculate(SUMX(q4, q4[No. of Quotes]), FILTER(ALL(q4), q4[Month Bucket] = SELECTEDVALUE(q4[Month Bucket])))
 
Replace q4 with the table name.
 
ChiragGarg2512_0-1696335872010.png

 

Perfect! Thank you so much

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors