cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

DAX - Calculate total for LY minus one day

I need a simple calculation that will give me the count of sales for prior year minus one day (today).

 

Can someone help?

1 ACCEPTED SOLUTION

Accepted Solutions
rajendran Super Contributor
Super Contributor

Re: DAX - Calculate total for LY minus one day

Can you try this?

 

CALCULATE(SUM(Sales_Fact.Sales),DATEADD(Dates[Date]-1,-1,YEAR)

 

Thanks
Raj

2 REPLIES 2

Re: DAX - Calculate total for LY minus one day

Measure = DATE(YEAR(NOW())-1,MONTH(NOW()), DAY(NOW()-1))

rajendran Super Contributor
Super Contributor

Re: DAX - Calculate total for LY minus one day

Can you try this?

 

CALCULATE(SUM(Sales_Fact.Sales),DATEADD(Dates[Date]-1,-1,YEAR)

 

Thanks
Raj

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 28 members 915 guests
Please welcome our newest community members: