Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
The message you are trying to access is permanently deleted.
Hi All,
I'm stuck and need help. I have a simple table with just Date and Units as shown below. I need to create a column to return value from the same month in previous year in Power Pivot Data Model. Unfortunately, I have tried the following DAX formula but all return as Blank value,
=CALCULATE(SUM([Units]), SAMEPERIODLASTYEAR(Table1[Date]))=CALCULATE(SUM([Units]), DATEADD(Table1[Date], -1, YEAR))
Alternatively, I have tried using PREVIOUSYEAR. There are numbers showing but it's incorrect and I cant figure it out why either
=CALCULATE(SUM([Units]), PREVIOUSYEAR(Table1[Date]))
Hope someone could enlighten me, thank you!!
Solved! Go to Solution.
Hi
Sorry for the first answer, I misunderstood your question and now I noticed you want a Calculated Column, instead of a Measure.
Try this:
CALCULATE (
SUM ( Table1[Units] );
ALL ( Table1 );
SAMEPERIODLASTYEAR ( Table1[Date] )
)
Hi
Sorry for the first answer, I misunderstood your question and now I noticed you want a Calculated Column, instead of a Measure.
Try this:
CALCULATE (
SUM ( Table1[Units] );
ALL ( Table1 );
SAMEPERIODLASTYEAR ( Table1[Date] )
)
Thank you, I just realize it's a filter seting issue, not exactly the same as your solution but your help has definitely enlightened me and I appreciate a lot
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |