Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
HI there,
I am trying to calculate the same period last year over a sales data that has data from 01-04-2013 till 31-01-2016. I am able to get the monthwise sale & running sales for the data but as soon as i am trying to bring the sameperiod last year measure to the matrix visual, i am presented with time contiguos error.
Here is what i tried
Sales_YTD - Calculate(sales,datesytd(datekey(date))) -- Working good
previousyear sale - calculate(sales,sameperiodlastyear(datekey(date))) --Measure created successfully but throwing error when using.
Any idea??
I suspect your error may be from the grand total column at the end. The grand totals are for multiple years, and hence are not contiguous.
@MattAllington : i didn't understand your suggestion completely. Can you please be more elaborative. Further, Which grand total column you are talking about. There are two column under TOTAL header column. one is for sales total & another one is for ytd running total. is there a way to avoid this total column from showing up in the visual ??
Apart from my doubt above, I am stuck on this & not able to proceed further to complete my dashborad. it would be great if you help me in resolving it.
regards,
In DAX, both functions must be based on contiguous date collection. In this scenario, the datesytd() function only evaluates dates within current year. But sameperiodlastyear() function will evaluate the date back to last year. It may have missing date in last year range which makes it not "contiguous". Please check the source data.
Regards,
Sorry, I am not at my PC to test or check (only iPad). Try putting year on the rows in your matrix, and the. Months below that, also on rows. If the error goes away, then that is the problem. You can check the visualisation tools (paint brush) to see if you can run off grand Totals for rows.
@MattAllington : it worked mate. The moment i put both year & month one below another in rows the error got away.
Thanks for guiding me.
Regards
User | Count |
---|---|
81 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |