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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
victor_obi
New Member

Count values of most recent dates regardless of category

Hello,

 

I created a measure to find the most recent quarter of my data set and count values for that quarter. In my case, the most recent quarter is 2023 Q1. The output is based on an hierarchical overview by organizational level (see screenshot). The problem is that my measure counts the most recent value per row and does not consider the entire data set when finding the last quarter. 

For example (see screenshot): One case only has 2 values in 2022 Q1 and 2022 Q2. In the overview, the number of values in the most recent quarter still counts = 1. As this case does not have a value in 2023 Q1, it should count 0. I assume the measure considers 2022 Q2 as most recent quarter as it is only looking to a specific organizational level. I'd like it to consider the total data set when finding most recent quarter. Any ideas how to do that? 

 

Measure:

#Portfolios lastQuarter =
var mostRecentQuarter=calculate(max('Data'[Subcol_Year_Quarter]))
return
calculate(count('Data'[Portfolio Scope]),filter('Data','Data'[Subcol_Year_Quarter]=mostRecentQuarter))
 
Overview: 
 
Capture.PNG
 
 
 
 
 
 
 
 
Thanks for your help. 
0 REPLIES 0

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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