Showing results for 
Search instead for 
Did you mean: 
Post Patron
Post Patron

Count quantity of months based on value


I need to count the quantity of months that I have to the end of the model.


This a measure that calcules a value based on the category. 

=CALCULATE(SUM(FT_Forecast[Amount]),FILTER(FT_Forecast,[Category]="Solution Contingency"))


There is another column with date and what I need is to calculate the remaining months that contains this value/measure.


Any ideas ?


Thanks !

Super User III
Super User III

Please provide some data for us to work with with expecte results. I suspect either LASTDATE(), LASTNONBLANK(), or LASTNONBLANKVALUE() will be in the solution, but I'm not going to mock up fake data and try to guess what your data and needs actually are. If I have some test data to work with, I can assist.


How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting

Hi @edhans


I hope this can help.:


As you see here I need 3 Measures that can calculate:

Count of months:  Count the quantity of months that contains amount in the category "Solution Contingency". In the example below we have only 5 months with amount of that category. 

SC Last date:  Calculate the last month that contains amount in that category. Example > Feb 2021

Last date: the last date of the model. Example > June 2021



Thanks !

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors