cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RVBalazs
New Member

[Help] "The syntax for 'interval' is incorrect"

Hi, sorry if this is repeated, but i can't find  a solution in other post.

I'm new in Power BI.

 

I'm getting this error for almost every time intelligence function i'd tried, allways in the interval value. for example, in this column:

 

Periodo = CALCULATE ( 
            sum('adm_dandtab MedicionesLimites'[Cantidad]), 
            DATESINPERIOD('adm_dandtab Limites'[Fecha].[Date], 'adm_dandtab MedicionesLimites'[Fecha_mes], 1, MONTH)
            )

Thanks in advance for your time.

1 ACCEPTED SOLUTION

Finally i make it work, don't know how or why haha
but on the time intelligence functions i leave a space between the parameters <number_of_intervals> and <interval>

Periodo = CALCULATE ( 
            sum('adm_dandtab MedicionesLimites'[Cantidad]), 
            PARALLELPERIOD( 'adm_dandtab Limites'[Fecha].[Date], 1, , MONTH )
            )

with this it works fine

View solution in original post

8 REPLIES 8
Yemeng_Hu
Frequent Visitor

What is the max([Dates]) of your data?

Time intellegence only can return dates within the [Dates] that you have,  

 

Since you want to check [Camtodad] in next month, you may not have that in your data. 

 

+1 means one month later, -1 means one month earlier.  

 

Thanks,

Yemeng

Anonymous
Not applicable

Hey @RVBalazs

 

I'm going out on a limb here but the second argument in your DATESINPERIOD function is [Fecha_mes] so is this only a month value? I assume this is not a date so you can't use a 1 month interval. Maybe replace that with your [Fecha] column.

 

Hope this helps,

Parker

 

 

Hi @Anonymous.

 

Thanks for answer, and yes, in that example "[Fecha_mes]" is only the month, a bit of desperation haha but before that i tried with the "[Fecha]" column and get the same error,  with manually input dates and the same error, even try to change the "," with ";" and that was worst.

Anonymous
Not applicable

@RVBalazs

 

Weird, could you post a snippet of the data that you're working with?

 

Thanks,

Parker

2018-05-09_15-47-40.jpg

 

@Anonymous here is a snippet of the data, with the two columns i'm trying to read in red.

 

@Yemeng_Hu the Dates values goes between 01-2017 to 09-2017

Anonymous
Not applicable

@RVBalazs

 

Not sure if this will help, but can you try:

 

Periodo = CALCULATE ( 
            sum('adm_dandtab MedicionesLimites'[Cantidad]), 
            DATESINPERIOD('adm_dandtab Limites'[Fecha], FIRSTDATE('adm_dandtab MedicionesLimites'[Fecha]), 1, MONTH)
            )

 

Note: I took off the .[Date] and changed Fecha_Mes to Fecha. I also added FIRSTDATE.

 

Let me know if that helps

Parker 

Finally i make it work, don't know how or why haha
but on the time intelligence functions i leave a space between the parameters <number_of_intervals> and <interval>

Periodo = CALCULATE ( 
            sum('adm_dandtab MedicionesLimites'[Cantidad]), 
            PARALLELPERIOD( 'adm_dandtab Limites'[Fecha].[Date], 1, , MONTH )
            )

with this it works fine

View solution in original post

Could anyone at powerbi please fix the parser and/or the documentation for datesinperiod a.s.o?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!