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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors