Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Some functions only work with "contiguous selections". What are they exactly? For example,
Function 'SAMEPERIODLASTYEAR' expects a contiguous selection when the date column is not unique, has gaps or it contains time portion. And what is meant here "date column is not unique"?
Solved! Go to Solution.
Right, but it's not a big deal 🙂 You need to create a separate date table, then relate your current table, to the date table.
Probably the easiest way is to use New Table in the Modeling ribbon, and type "Dates = CALENDARAUTO()"
All of the time intelligence functions require a date table (more like a date column) as a parameter. That date column has to include every date (say, incluing weekends and holidays) with no "gaps". That is what is meant by continguous (which, sounds similiar to "continuous").
Some weird things can happen though, if you are trying to use these time intelligence functions like SAMEPERIODLASTYEAR... if you use a slicer to remove rows from the middle. Same period last year wants to look at just exactly 1 "period" -- that can be a week, day, month, 4.6 weeks... but they need to be 1 continuous range not like "the 1st and 4th week of July" (which would have a gap... in the 2nd and 3rd weeks, and is not allowed).
Does that mean that I cannot use time intelligence functions for a data set like this:
Date Sales 2016-01-01 100 2016-01-04 80 2016-01-20 200 2017-01-02 60 2017-01-05 40 2017-01-21 20
I.e. I will not be able to compare January-2016 to January-2017 because dates are not "contiguous"?
Right, but it's not a big deal 🙂 You need to create a separate date table, then relate your current table, to the date table.
Probably the easiest way is to use New Table in the Modeling ribbon, and type "Dates = CALENDARAUTO()"
We are facing this issue in those cases when sale of a particular brand was not in previous year but it is in current year. How can we resolve this issue if getting the same error? (Function 'SAMEPERIODLASTYEAR' expects a contiguous selection when the date column is not unique, has gaps or it contains time portion.). Is there any way to define last year value as zero for all those cases where no value exists? I have tried with IFERROR and HASONEVALUE but these are also not working.
Hi! Could you please help me? I created a new calendar table for reference, activated time intelligence, built a relationship between my two tables (calendar table and Sales data dump table), but can't figure out my formula now.
OK, now I understand, why they talk in many threads about having a separate date table! Thanks!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |