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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DataSundowner
Helper II
Helper II

Get Same Week Ending Prior Year Using DAX

Hello everyone. I'm trying to get same week ending (Sunday) of prior year for each week. I get it to work using the following, but it only works for date goes back to 1/9/2022. If I bring in the weekending date of 1/2/2022, the formula that looks for same week prior year will fail. It gives an error saying "a table of multiple values was supplied where a single value was expected". 1/2/2022 is technically the 52th week of 2021 by ISO standard, so I would like the formula to return the Sunday of 52th week of 2020 which is 12/27/2020. I have the date dimension table that maps each date to ISO year and ISO week number. How can I fix this? Thank you in advance! 

DataSundowner_0-1670007363098.png

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The best way to fix this is not to attempt to compute it.  Use a static calendar table that has all the required columns predefined.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

The best way to fix this is not to attempt to compute it.  Use a static calendar table that has all the required columns predefined.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors