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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Help Needed with Prior Year totals grouped by Vendor

Hi, 

 

Im looking to create sales totals by vendor and month, as well as prior year, current YTD and prior YTD. For Prior Year, im using:

Prior Year = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date Table'[Date]))

 

 

However, when i run this i only get the total prior year, and it isnt broken down by specific vendor. Is there a portion of DAX im missing to make this happen?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Greg_Deckler Thanks! I was able to fix this by examining the relationships a bit more. It seems my filtering criteria was using the dates from the Sales table, not the joined calendar table. Once I changed that to run off the calendar table, all worked as expected! Appreciate the help

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Anonymous - My guess is that you have something in your [Total Sales] measure calculation that is causing this. Probably an ALL statement or something like that. Can you post the code for [Total Sales]?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler, thanks for the reply. Im using a very simple formula for total sales:

 

 

Total Sales = SUM('Detail Reports'[Amount])

 

 

 

Ive tried using just the SUM() within the Prior year calculation as well, and that doesnt work either.  

@Anonymous - Hmm, maybe a missing relationship? It's difficult to say wihtout understanding your data model and how you are using these things in visuals. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks! I was able to fix this by examining the relationships a bit more. It seems my filtering criteria was using the dates from the Sales table, not the joined calendar table. Once I changed that to run off the calendar table, all worked as expected! Appreciate the help

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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.