mgirvin
Well-known Member
- Joined
- Dec 15, 2005
- Messages
- 1,245
- Office Version
- 365
- Platform
- Windows
Dear Team,
In Excel we can lookup a value using INDEX and MATCH function, where the MATCH function returns the row number or relative position of an item in a list. How do we do this is DAX? Specifically, I have a calculated column and this formula that returns the relative position (or row number) of an item in a column:
=COUNTROWS(FILTER(disDiscount,disDiscount[Units]<=fSales[Quanity]))
For each row in this Calculated Column, that formula is returning a number between 1 and 7, which represents the row in a column that contains the item I want to go and get and bring back to the calculated column.
I can't use a formula like this:
=CALCULATE(MAX(disDiscount[Discount]),FILTER(disDiscount,disDiscount[Units]<=fSales[Quanity]))
because the value I am looking up is not always the MAX value.
I need a lookup formula that return an item in a column based on its position.
What DAX Function can I use to lookup an item in a column based on its position?
In Excel we can lookup a value using INDEX and MATCH function, where the MATCH function returns the row number or relative position of an item in a list. How do we do this is DAX? Specifically, I have a calculated column and this formula that returns the relative position (or row number) of an item in a column:
=COUNTROWS(FILTER(disDiscount,disDiscount[Units]<=fSales[Quanity]))
For each row in this Calculated Column, that formula is returning a number between 1 and 7, which represents the row in a column that contains the item I want to go and get and bring back to the calculated column.
I can't use a formula like this:
=CALCULATE(MAX(disDiscount[Discount]),FILTER(disDiscount,disDiscount[Units]<=fSales[Quanity]))
because the value I am looking up is not always the MAX value.
I need a lookup formula that return an item in a column based on its position.
What DAX Function can I use to lookup an item in a column based on its position?