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
Erik70
Frequent Visitor

same day last year

Hi,

im struggling to get this "same day last year" to work.

i have ordersum and if i set filters manually it will show the correct value but i want it to automatically look at todays date and show me today one year ago for comparison.

 

the "ordersumma" column and the "upplagd" column are all in the same table.

Erik70_0-1663595003131.png Erik70_1-1663595143606.png

 

any ideas how to get this to work is much appreciated.

 

//:Erik

 

 

 

 

1 ACCEPTED SOLUTION
v-xiaosun-msft
Community Support
Community Support

Hi @Erik70 ,

 

According to your description, I created a sample and here is my solution.

vxiaosunmsft_0-1663641709842.png

Create a measure.

measure =
SUMX (
    FILTER (
        ALL ( 'PBI_kundorder' ),
        [Upplagd] = EDATE ( MAX ( 'PBI_kundorder'[Upplagd] ), -12 )
    ),
    [Ordersumma]
)

Final output:

vxiaosunmsft_1-1663641737886.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xiaosun-msft
Community Support
Community Support

Hi @Erik70 ,

 

According to your description, I created a sample and here is my solution.

vxiaosunmsft_0-1663641709842.png

Create a measure.

measure =
SUMX (
    FILTER (
        ALL ( 'PBI_kundorder' ),
        [Upplagd] = EDATE ( MAX ( 'PBI_kundorder'[Upplagd] ), -12 )
    ),
    [Ordersumma]
)

Final output:

vxiaosunmsft_1-1663641737886.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@Erik70 Try:

 

Measure =
  VAR __Today = TODAY()
  VAR __1YearAgo = DATE(YEAR(__Today)-1,MONTH(__Today),DAY(__Today))
RETURN
  SUMX(FILTER(ALL('PBI_kundorder'),[Upplagd] = __1YearAgo),[Ordersumma])

 



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

Hi, thanks for your effort but neither of the suggested fixes seems to work, no errors just blank (renamed it to lastyear2)! wondering if this has to do with that the date includes a timestamp also? 

Erik70_0-1663661637039.png

Hi, thanks for your effort but neither of the suggested fixes seems to work, no errors just blank renamed it to lastyear! wondering if this has to do with that the date includes a timestamp also? 

Erik70_0-1663661637039.png

 

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.