Forum Discussion
MWare
Helper I
3 years agoDAX Calculation to retrieve the entry before pt2
Hi, Looking for some help please. I am trying to return the previous 'Sale Product' based on the 'Sales Person' of each row in my 'Sales' table. Unfortunatley the index is based on all sales...
- 3 years ago
Hi MWare ,
Please try:
Column = VAR _a = MAXX ( FILTER ( 'Table', [Sale Person] = EARLIER ( 'Table'[Sale Person] ) && [Shop Sale Index] < EARLIER ( 'Table'[Shop Sale Index] ) ), [Shop Sale Index] ) VAR _b = MAXX ( FILTER ( 'Table', [Sale Person] = EARLIER ( 'Table'[Sale Person] ) && [Shop Sale Index] = _a ), [Sale Product] ) RETURN _bFinal output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 3 years ago
Thank you very much this works a treat!
v-jianboli-msft
Community Support
3 years agoHi MWare ,
Please try:
Column =
VAR _a =
MAXX (
FILTER (
'Table',
[Sale Person] = EARLIER ( 'Table'[Sale Person] )
&& [Shop Sale Index] < EARLIER ( 'Table'[Shop Sale Index] )
),
[Shop Sale Index]
)
VAR _b =
MAXX (
FILTER (
'Table',
[Sale Person] = EARLIER ( 'Table'[Sale Person] )
&& [Shop Sale Index] = _a
),
[Sale Product]
)
RETURN
_b
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- MWare3 years ago
Helper I
Thank you very much this works a treat!