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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bueroj
New Member

Need a Subtotal that filters current YTD and Prior YTD

I am trying to measure the percent change from now compared to the prior year. Prior year is calculated using the SAMEPERIODLASTYEAR function which seems to prevent most solutions I'm finding online.

 

I want my subtotals in my matrix to ignore rows that aren't populated for both the current year and the prior year.

 

Here is sample data:

1 Data.png

 

Here are the results I get vs what I want:

2 Results.png

 

I feel like I must be missing some simple solution, something with SWITCH, FILTER, or SUMX or some combination of these... 

 

Please help!

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@bueroj,

 

You may use ISINSCOPE to add a measure.

https://community.powerbi.com/t5/Desktop/Matrix-How-to-avoid-Total-and-Subtotal-aggregation-for-a-fi...

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

@v-chuncz-msft thanks for the reply. However I don't see how ISINSCOPE will help. It looks like that just removed subtotals for everything. I want to exclude select records from the subtotal (records that don't have data in BOTH year 1 and year 2). Am I missing how to use ISINSCOPE to identify records not in both years? I do want to have the subtotal displayed, I just want it to exclude particular records depending on if the record was there last year and this year. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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