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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
lennyt99
Helper I
Helper I

Volume Last year not working...

Greetings and thanks in advanced...
 
I have volume categorized by fiscal year and now I want to display YOY and YTD, however it's not working. This is what I have for Volume Last Year:
 
Volume LY =
CALCULATE(
SUM('Opportunity Tracker 2.0'[Annual Volume LBS]),
DATEADD('Fiscal Calendar'[Daily Date], -12, MONTH
))
 
and this is what is looks like: 
lennyt99_0-1666205965000.png

 

Please help. 

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@lennyt99 Maybe:

Volume LY =
  VAR __Date = MAX('Fiscal Calendar'[Daily Date])
  VAR __LYDate = EOMONTH(__Date,-12)
  VAR __LYEndDate = DATE(YEAR(__LYDate),MONTH(__LYDate),DAY(__Date))
  VAR __LYDateStart = EOMONTH(__LYDate,-12)
  VAR __LYStartDate = DATE(YEAR(__LYDateStart),MONTH(__LYDateStart),DAY(__Date))
RETURN
  SUMX(FILTER('Opportunity Tracker 2.0',[Date]>=__LYStartDate && [Date]<=__LYEndDate),[Annual Volume LBS])

 

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



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...

View solution in original post

@Greg_Deckler Scratch that last post...

 

lennyt99_0-1666209258466.png

So it's displaying the correct abmount of volume last year, however no values are appearing?? This is odd

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@lennyt99 Maybe:

Volume LY =
  VAR __Date = MAX('Fiscal Calendar'[Daily Date])
  VAR __LYDate = EOMONTH(__Date,-12)
  VAR __LYEndDate = DATE(YEAR(__LYDate),MONTH(__LYDate),DAY(__Date))
  VAR __LYDateStart = EOMONTH(__LYDate,-12)
  VAR __LYStartDate = DATE(YEAR(__LYDateStart),MONTH(__LYDateStart),DAY(__Date))
RETURN
  SUMX(FILTER('Opportunity Tracker 2.0',[Date]>=__LYStartDate && [Date]<=__LYEndDate),[Annual Volume LBS])

 

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



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...

@Greg_Deckler Scratch that last post...

 

lennyt99_0-1666209258466.png

So it's displaying the correct abmount of volume last year, however no values are appearing?? This is odd

@Greg_Deckler Your amazing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@lennyt99 Sorry, forgot the ALL:

Volume LY =
  VAR __Date = MAX('Fiscal Calendar'[Daily Date])
  VAR __LYDate = EOMONTH(__Date,-12)
  VAR __LYEndDate = DATE(YEAR(__LYDate),MONTH(__LYDate),DAY(__Date))
  VAR __LYDateStart = EOMONTH(__LYDate,-12)
  VAR __LYStartDate = DATE(YEAR(__LYDateStart),MONTH(__LYDateStart),DAY(__Date))
RETURN
  SUMX(FILTER(ALL('Opportunity Tracker 2.0'),[Date]>=__LYStartDate && [Date]<=__LYEndDate),[Annual Volume LBS])


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...

@Greg_Deckler I like your thinking!

 

Unfortunately it didn't work. I have a relationship created with my fiscal calendar to the "date" in the opportunity tracker. It's so werid I don't know why it's not working. I would assume sameperiodlast year would work... It's not even returning anything

 

Thank you in advnce

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.