Forum Discussion
PiyushBQ
Helper I
4 years agoFind MAX Value based on Date Silcer
Hello,
I have this data:
| Date | Ticker | Close |
| 11-May-22 | AA | 56.66 |
| 10-May-22 | AA | 55.84 |
| 9-May-22 | AA | 54.21 |
| 6-May-22 | AA | 61.04 |
| 5-May-22 | AA | 63.46 |
| 4-May-22 | AA | 67.96 |
| 3-May-22 | AA | 64.66 |
| 2-May-22 | AA | 66.16 |
| 11-May-22 | AACG | 1.04 |
| 10-May-22 | AACG | 1.075 |
| 9-May-22 | AACG | 1.07 |
| 5-May-22 | AACG | 1.17 |
| 2-May-22 | AACG | 1.16 |
| 6-May-22 | AACG | 1.14 |
| 4-May-22 | AACG | 1.1466 |
| 3-May-22 | AACG | 1.16 |
How do I find the maximum closing price, based on date slicer.
Example: If I set the date slicer to "11 May and 10 May" then the output should look like this:
| Date | Ticker | Close | Max Close |
| 11-May-22 | AA | 56.66 | 56.66 |
| 10-May-22 | AA | 55.84 | 56.66 |
| 11-May-22 | AACG | 1.04 | 1.075 |
| 10-May-22 | AACG | 1.075 | 1.075 |
Similarly, if I widen the date slicer to cover more dates, the table should update dynamically.
I'm not adding new columns to keep the actual dataset manageable.
Thanks in advance!
Piyush
Hi,
The below is for creating a measure without having DIM-Calendar table.
Please check the below picture and the attached pbix file.
Max close measure: = IF ( HASONEVALUE ( Data[Ticker] ), MAXX ( FILTER ( ALLSELECTED ( Data ), Data[Ticker] = MAX ( Data[Ticker] ) ), Data[Close] ) )
2 Replies
- Jihwan_Kim
Super User
Hi,
The below is for creating a measure without having DIM-Calendar table.
Please check the below picture and the attached pbix file.
Max close measure: = IF ( HASONEVALUE ( Data[Ticker] ), MAXX ( FILTER ( ALLSELECTED ( Data ), Data[Ticker] = MAX ( Data[Ticker] ) ), Data[Close] ) ) - PiyushBQ
Helper I
This is perfect, thank you so much Jihwan_Kim 😄