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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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