Forum Discussion
Boycie92
5 years agoResolver I
Power Query Date Table: Current 6 Months
Hi, I am hoping someone can help. I have created a date table in Power Query using the following code: let fnDateTable = (StartDate as date, EndDate as date, optional FYStartMonthNum as n...
lbendlin
5 years agoSuper User
"This should be dynamic and adjust to the day/date you look at the data"
That means you would need a measure
Measure = TODAY()
It also means that you cannot create a flag based on this. Measures cannot impact columns. They can only impact other measures.
Consequently you would need to implement your entire logic through measures. Possible, but rather inefficient.
If you let go of your first requirement and allow this to be a calculated column (only refreshed when dataset is updated) then everything would become much easier.
- Boycie925 years agoResolver I
HI lbendlin
I have somthing simialr built into the M code: CurrentDateRecord = Table.SelectRows(AddFY, each ([Date] = CurrentDate))
Would that not work?
If it has to be a caculated column then I would be ok with that.
what formual would I need to use for it?
Thanks,
Boycie92
- lbendlin5 years agoSuper User
Doing it in M code is the same (sort of) as doing it in a calculated column. It is only computed once during the dataset refresh. If you do not refresh your dataset frequently then the meaning of "CurrentDate" will get skewed as you move on from the date when the dataset was last refreshed.
So yes, your approach would work, but it would not be dynamic.