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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Diff Between Not Calculating

My Diff Between Calc is presenting zeros:

 

YearProduct CategoryProduct ValueACV Product Value LYACV Diff Between TY LY
12/31/2011 0:00A$131,282.70$131,282.70$0.00
12/31/2012 0:00A$1,397,633.70$1,397,633.70$0.00
12/31/2013 0:00A$2,472,531.60$2,472,531.60$0.00
12/31/2014 0:00A$4,010,372.20$4,010,372.20$0.00
12/31/2015 0:00A$5,295,672.70$5,295,672.70$0.00
12/31/2016 0:00A$6,553,524.60$6,553,524.60$0.00
12/31/2017 0:00A$7,571,281.70$7,571,281.70$0.00
12/31/2018 0:00A$8,999,105.40$8,999,105.40$0.00
12/31/2019 0:00A$9,793,244.80$9,793,244.80$0.00
12/31/2020 0:00A$10,312,240.56 $10,312,240.56

 

DAX is: 

ACV Diff Between TY LY = SUM('Divya ACV'[Product Value]) - [ACV Product Value LY]
ACV Product Value LY = CALCULATE (SUM('Divya ACV'[Product Value]),SAMEPERIODLASTYEAR('Calendar Table'[Date]))
 
Clearly the product value is duplicating.
 
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this approach:

  1. Create a Calendar Table and write calculated column formulas to extract Year, Month name and Month number.  Year = Year(Calendar[Date]), Month name = FORMAT(Calendar[Date],"mmmm") and Month number = MONTH(Calendar[Date[)
  2. Sort the Month Name column by the Month number
  3. Build a relationship from the Date column in your Divya ACV Table to the Date column of your Calendar Table
  4. To your visual, drag Year and Month name from the Calendar Table
  5. Write these measures

Total value = SUM('Divya ACV'[Product Value])

ACV Product Value LY = CALCULATE ([Total value],SAMEPERIODLASTYEAR('Calendar'[Date]))

ACV Diff Between TY LY = [Total value] - [ACV Product Value LY]

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

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...
Anonymous
Not applicable

This is great, I will be referencing this when I get to the YOY % difference!  I've bookmarked it for sure!

 

Ashish_Mathur
Super User
Super User

Hi,

Try this approach:

  1. Create a Calendar Table and write calculated column formulas to extract Year, Month name and Month number.  Year = Year(Calendar[Date]), Month name = FORMAT(Calendar[Date],"mmmm") and Month number = MONTH(Calendar[Date[)
  2. Sort the Month Name column by the Month number
  3. Build a relationship from the Date column in your Divya ACV Table to the Date column of your Calendar Table
  4. To your visual, drag Year and Month name from the Calendar Table
  5. Write these measures

Total value = SUM('Divya ACV'[Product Value])

ACV Product Value LY = CALCULATE ([Total value],SAMEPERIODLASTYEAR('Calendar'[Date]))

ACV Diff Between TY LY = [Total value] - [ACV Product Value LY]

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Anonymous 

Your Calendar Table should be marked as a Date table. Especially when join is on Non date columns.

Try following

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR('Date'[Date])),"12/31"))

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you. 

I found needed to create a new measure to in my measures table for the Product Value and use the following general syntax:

ACV Product Value LY = CALCULATE ([Total value],SAMEPERIODLASTYEAR('Calendar'[Date]))

I also pulled the year from my date table instead of my table from the original data pull. 

 

This brought me to a new issue.  So for YOY on ACV (Annual Contract Value), for multiple years I found that I need to be pulling a simple subtraction between the earliest and latest years instead of summing up all of the changes YOY for each date. 

For example, the ACV difference between 2012 and 2014 should be 2.6 (2014 ACV of 4.0 - 2012 ACV of 1.4) instead of adding the ACV difference of 2012, 2013, and 2014. 

 

If you know what language I need to complete for this let me know, otherwise I will repost a new question. Thanks!

Hi,

Whom are you asking that question?  Show data in a Table and also the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

The goal is for me to present a dynamic visual card that changes based on the years selected. I've bolded the information needed from the table above - see below. The desired result is in bold. The last two columns illustrate the differences in calculations. I believe I have to do some type of min/max year language to get to my ideal answer. 

YearProduct CategoryACVACV Product Value LYACV Diff Between TY LYCurrent AnswerIdeal Answer 
2011A$131,282.70 $131,282.70Looking for difference in ACV from 2012-2014  
2012A$1,397,633.70$131,282.70$1,266,351.00   
2013A$2,472,531.60$1,397,633.70$1,074,897.90   
2014A$4,010,372.20$2,472,531.60$1,537,840.60$3,879,089.50$2,612,738.50 
2015A$5,295,672.70$4,010,372.20$1,285,300.50(sum of ADV Diff 3 yrs) - Column 5(subtracts ACV Diff between 2014 and 2012) - Column 3
2016A$6,553,524.60$5,295,672.70$1,257,851.90 
2017A$7,571,281.70$6,553,524.60$1,017,757.10   

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.