Help with MAXROW expression

Jaros
New Member

Hi Community,

I need assistance with an expression. I am trying to get the record for the previous week number, with the column name [Weekly_INV_Week_Number], sitting on the Weekly inventory table.

I tried both expressions below, one I found to be a solution on another question that has happened before but for both

MAXROW(Weekly Inventory[Weekly_INV_Week_Number],
[Weekly_INV_Week_Number] <
[_THISROW].[Weekly_INV_Week_Number]
)

MAXROW(Weekly Inventory[Weekly_INV_Week_Number],
[Weekly_INV_Week_Number] <
[_THISROW-0].[Weekly_INV_Week_Number]
)

Both of them return the same error message, โ€œFunction โ€˜MAXROWโ€™ should have at least two parameters: a table name, a column name, and an optional filter expressionโ€.

Not sure where I am going wrong?

Solved Solved
0 1 204
1 ACCEPTED SOLUTION

The syntax of MAXROW() function is as given in the article below

MAXROW( dataset-name , column-name [ , select-row? ] )

So presuming you are looking for the row reference of the previous week, your expression can be something like

MAXROW(โ€œWeekly Inventoryโ€, โ€œWeekly_INV_Week_Numberโ€, [Weekly_INV_Week_Number] <
[_THISROW].[Weekly_INV_Week_Number] )

The above expression should be syntactically correct. However please check if it is returning the correct record. It sounds that you may need to revise the highlighted condition, depending on what you exactly mean by the previous week.

View solution in original post

1 REPLY 1

The syntax of MAXROW() function is as given in the article below

MAXROW( dataset-name , column-name [ , select-row? ] )

So presuming you are looking for the row reference of the previous week, your expression can be something like

MAXROW(โ€œWeekly Inventoryโ€, โ€œWeekly_INV_Week_Numberโ€, [Weekly_INV_Week_Number] <
[_THISROW].[Weekly_INV_Week_Number] )

The above expression should be syntactically correct. However please check if it is returning the correct record. It sounds that you may need to revise the highlighted condition, depending on what you exactly mean by the previous week.

Top Labels in this Space