Forum Discussion
Retrieve value based on latest date
Hi, Need your help in pulling the values based on the latest date.
Following is what I am trying to achieve:
| Order Date | Customer | Amount |
| 11/5/2015 | Andy | 3844 |
| 9/8/2014 | Bill | 3494 |
| 10/2/2015 | Andy | 944 |
| 5/13/2014 | Sara | 589 |
| 7/4/2018 | Ken | 4380 |
| 12/25/2015 | Andy | 855 |
| 1/19/2016 | Bill | 485 |
| 3/14/2017 | Ken | 8473 |
| 6/29/2015 | Andy | 4855 |
| Result: | ||
| Order Date | Customer | Amount |
| 12/25/2015 | Andy | 855 |
| 1/19/2016 | Bill | 485 |
| 7/4/2018 | Ken | 4380 |
| 5/13/2014 | Sara | 589 |
I am only looking to achieve this using measures and my data comes from live connection.
Appreciate your help,
Regards,
SN
Hi, Anonymous
You can create a measure and put it in filter pane to filter data.
Like this:
Measure = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [Customer] = SELECTEDVALUE ( 'Table'[Customer] ) ), [Order Date] ) RETURN IF ( SELECTEDVALUE ( 'Table'[Order Date] ) = a, 1, 0 )If you still have problems, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-janeyg-msftCommunity Support
Hi, Anonymous
You can create a measure and put it in filter pane to filter data.
Like this:
Measure = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [Customer] = SELECTEDVALUE ( 'Table'[Customer] ) ), [Order Date] ) RETURN IF ( SELECTEDVALUE ( 'Table'[Order Date] ) = a, 1, 0 )If you still have problems, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandakSuper User
Anonymous , Try a new measure like
Measure =
VAR __id = MAX ('Table'[Customer] )
VAR __date = CALCULATE ( MAX('Table'[Order Date] ), ALLSELECTED ('Table' ), 'Table'[Customer] = __id )
CALCULATE ( sum ('Table'[Amount] ), VALUES ('Table'[Customer] ),'Table'[Customer] = __id,'Table'[Order Date] = __date )