JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I have a query with a parameter, M code begins:
TimeCol represents a unique value in field "Date Period" from table "TradeData"
As TradeData grows over time, for another table, "Headline", I only need the latest 25 rows from TradeData in order to generate monthly summaries. This is also reducing the query refresh time by not pulling in the entire data set.
Using pysudo code, I'm trying to achieve:
Else, use a second parameter to the query but so far this hasn't work - How can I include this switch within the query above?
TIA,
Jack
I have a query with a parameter, M code begins:
Excel Formula:
(TimeCol) =>
let Source = TradeData,
GroupColumns = {TimeCol, "Security", "Security Type"},
/*R, PnL*/
R = Table.SelectColumns(Source,List.Combine({GroupColumns, {"R"}})),
TimeCol represents a unique value in field "Date Period" from table "TradeData"
As TradeData grows over time, for another table, "Headline", I only need the latest 25 rows from TradeData in order to generate monthly summaries. This is also reducing the query refresh time by not pulling in the entire data set.
Using pysudo code, I'm trying to achieve:
VBA Code:
IF TimeCol = "Headline" THEN
let Source = Table.LastN(TradeData, 25)
ELSE
let Source = TradeData
END IF
Else, use a second parameter to the query but so far this hasn't work - How can I include this switch within the query above?
TIA,
Jack