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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tyannamorrison
Frequent Visitor

Counting dates that fall in the past 6 months of a date in Power BI

I am trying to find a renewal rate of customers who are renewing there account. With the data I am given I am given a expiration date and an invoice date. For my formula I want to capture the COUNT of accounts that are up for renewal in the past 6 months. Meaning if TODAY is 6 months from the expiration date I have the output value needs to be 1. I am using a measure but it is not working. Where am I going wrong ? 

 

6Months = CALCULATE(SUM('License Table'[expiration_date]),DATESINPERIOD('License Table'[expiration_date],License Table'[expiration_date],-6,MONTH))

 

I want the output to be 1 if an account's expiration date is 6 months away from today. Capturing accounts 6 months away from their expiration date. 

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @tyannamorrison 

Have you check you data type of your filed  [expiration_date] ?

Please make sure that there is no comparison between text data and date data.

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

 

tyannamorrison
Frequent Visitor

tyannamorrison_0-1620139900627.png

Getting this error upon implemnting this measure.

amitchandak
Super User
Super User

@tyannamorrison , Try a new measure  like

 


6Months =
var _max = today()
var _min - date(year(_max), month(_max) -6, Day(_max))
return
CALCULATE(SUM('License Table'[expiration_date]),filter('License Table','License Table' [expiration_date] >=_min && 'License Table' [expiration_date]<=_max ))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.