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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Rolling Date Range

Hi,

 

I'm attempting to create  rolling date range, however, the basic statement I' m using to pull back the prior 7 days worth of data keeps giving an error. I would truly appreciate any assistance to fix this in the Advance Editior.

 

{Cube.ApplyParameter, "DateRange", Date.AddDays(Date.From(DateTime.LocalNow()),-1), Date.AddDays(Date.From(DateTime.LocalNow()),-8)},
{Cube.AddAndExpandDimensionColumn, "DateGranularity", {"year", "month", "day", "hour"}, {"Date Granularity.Level 1: Year", "Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day", "Date Granularity.Level 4: Hour"}},
{Cube.AddAndExpandDimensionColumn, "evar2", {"evar2"}, {"Platform (v2)"}},
{Cube.AddMeasureColumn, "Unique Visitors", "uniquevisitors"}
})
in
#"Added Items"

 

Error:

Expression.Error: 4 arguments were passed to a function which expects between 2 and 3.
Details:
Pattern=
Arguments=[List]

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can modify the function as follows.

 

{Cube.ApplyParameter, "DateRange",
List.Dates(Date.AddDays(Date.From(DateTime.LocalNow()),-8),7,#duration(1,0,0,0))},
{Cube.AddAndExpandDimensionColumn, "DateGranularity", {"year", "month", "day", "hour"}, {"Date Granularity.Level 1: Year", "Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day", "Date Granularity.Level 4: Hour"}},
{Cube.AddAndExpandDimensionColumn, "evar2", {"evar2"}, {"Platform (v2)"}},
{Cube.AddMeasureColumn, "Unique Visitors", "uniquevisitors"}
})
in
#"Added Items"
 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

34 REPLIES 34
Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Syndicate_Admin
Administrator
Administrator

Don't @deionb44,

Could you tell me if your problem has been solved? If so, please accept it as the solution. More people will benefit from it. Or you're still confused about it, please give me more details about your problem.

Best regards

Yuna

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors