Forum Discussion
How to create a parameter with dynamic Date query list
- 3 years ago
We're getting there 😄
You can't compare date and datetime types.
Change the StartOfCurrentMonth query to...
// StartOfCurrentMonth let Source = Date.StartOfMonth( DateTime.FixedLocalNow() ) in Source
I am trying to paste the code to the advanced editor, but can't figure out where did I go wrong:
let
Source = CommonDataService.Database("XXX.com"),
dbo_lvs_opportunityforecast = Source{[Schema="dbo",Item="lvs_opportunityforecast"]}[Data]
dbo_lvs_opportunityforecast = Date.StartOfMonth(
DateTime.Date(
DateTime.FixedLocalNow()
)
)
in
dbo_lvs_opportunityforecast
Did you do this step first?
If you have, you should be able to do something like...
(replace placeholder with your date column name)
let
Source = CommonDataService.Database(
"XXX.com"
),
dbo_lvs_opportunityforecast = Source{
[
Schema = "dbo",
Item = "lvs_opportunityforecast"
]
}[
Data
],
#"Filtered Rows" = Table.SelectRows(
dbo_lvs_opportunityforecast,
each
[
ReplaceThisWithTheNameOfYourDateColumn
] >= StartOfCurrentMonth
)
in
#"Filtered Rows"
- RL_1713 years agoFrequent Visitor
Bingo!! the query is working!! Thank you so much for sharing and being patience with me 😃
- RL_1713 years agoFrequent Visitor
I renamed Query1 and unchecked Enable Load, it shows a new error:
- KNP3 years agoSuper User
We're getting there 😄
You can't compare date and datetime types.
Change the StartOfCurrentMonth query to...
// StartOfCurrentMonth let Source = Date.StartOfMonth( DateTime.FixedLocalNow() ) in Source