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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
saurabhtd
Resolver II
Resolver II

Previous year Last week dax logic / How to get Last week sales for previous year  ?

How to get Last week sales for previous year ? 

@amitchandak @Sahir_Maharaj @Greg_Deckler @FreemanZ @Ashish_Mathur @olgad @tamerj1 @andhiii079845 

 

4 REPLIES 4
andhiii079845
Solution Sage
Solution Sage

Again, please a full example. This is completely unclear what your problem is.

https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/m-p...





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




andhiii079845
Solution Sage
Solution Sage

Please a example with some underlaying data and what do you want. Please read the pinned post how to ask for help. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DAXDigger
Regular Visitor

@saurabhtd This works well if you have disconnected date dimension table

Measure = 
VAR _selectedDate = Today() //SELECTEDVALUE(dimDate[Date])
VAR _startDate = (_selectedDate-(WEEKDAY(_selectedDate,2)-1))-7
VAR _pystartDate = DATE(YEAR(_startDate)-1,MONTH(_startDate),DAY(_startDate))
VAR _endDate = _startDate+6
VAR _pyendDate = DATE(YEAR(_endDate)-1,MONTH(_endDate),DAY(_endDate))
RETURN  CALCULATE(SUM(Table[Sales]),Table[Date] >= _pystartDate && Table[Date] <= _pyendDate)

 

I have connected calendar table. So this doesn't work.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.