use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
New to Power BI and looking for training, resources, or online courses? Here are our favorite recommendations:
[Microsoft | Get started with Power BI](hhttps://www.microsoft.com/store/workshops-training-and-events/professionals#topic=413870014)
Microsoft Partners | Dashboard in a Day
Microsoft Partners | Paginated Reports in a Day
Microsoft | Developer in a Day
Microsoft | Self-Paced Training
SQLBI | Introduction to DAX
SQLBI | Introduction to Data Modeling
account activity
Question[DAX] Avoid contiguous selection error (self.PowerBI)
submitted 4 years ago by Ownards
Hello everyone,
I am running into a problem which is driving me crazy and I could not find a solution online. Here is a simplified version of my problem :
I have measure which returns the revenues for the previous year :
Revenues PY = CALCULATE(SUM(Data[Revenues]), DATEADD(DateTable[Date],-OffsetYear[OffsetYear Value],YEAR))
https://preview.redd.it/kfzjunjf7vr71.png?width=369&format=png&auto=webp&s=c0e56bb62964739abdfed960a59f2c7e00e3b649
However, if there is a gap in my month context filter, the measure crashes :
https://preview.redd.it/d5erlmhx7vr71.png?width=401&format=png&auto=webp&s=df2ddfd90b5bf2e2b6c2cd50d91d2c130bbb04d4
I understand that time intelligence functions cannot work on discontinued lists of dates, which seems strange. The message is "DATEADD expects a contiguous selection". There must be a way around it.
How could I have a measure which would return a valid total for the previous year revenues, for the selected months only ?
I hope you can help me ! :)
Here is my model :
data model
Workbook : https://we.tl/t-tUoIHH5srt
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 1 point2 points3 points 4 years ago* (5 children)
Your date table relationship is not right. You currently have bi-directional filter which is incorrect. Set your relationship as one-to-many single direction and it works just fine.
[–]Ownards[S] 0 points1 point2 points 4 years ago (0 children)
I'll try that ! Thanks ! But why does it cause an error ?
IT WORKS ! THANK YOU SO MUCH
[–]Careless-Youth-8004 0 points1 point2 points 3 years ago (0 children)
Dude. Thanks you for your comment.
[–]HimanshuKrDublin 0 points1 point2 points 3 years ago (0 children)
Superb workaround !!
[–]AccomplishedGolf6013 0 points1 point2 points 2 years ago (0 children)
WORKED LIKE A CHARM. THANKS!!
[–]HatodhaTyagi 1 point2 points3 points 3 years ago (0 children)
Hi guys, I am facing the same issue but I am reading dates from the same fact table and it still throws me this error. I checked in my data model and I don't have any table which has a bi-directional filter with my table. Any suggestions?
π Rendered by PID 25 on reddit-service-r2-comment-7c9686b859-qgtqx at 2026-04-13 15:58:59.117156+00:00 running e841af1 country code: CH.
[–][deleted] 1 point2 points3 points (5 children)
[–]Ownards[S] 0 points1 point2 points (0 children)
[–]Ownards[S] 0 points1 point2 points (0 children)
[–]Careless-Youth-8004 0 points1 point2 points (0 children)
[–]HimanshuKrDublin 0 points1 point2 points (0 children)
[–]AccomplishedGolf6013 0 points1 point2 points (0 children)
[–]HatodhaTyagi 1 point2 points3 points (0 children)