Forum Discussion
Max value based on dynamic date filter
- Anonymous3 years ago
Hi itsmeanuj ,
Here are the steps you can follow:
1. Create measure.
Measure = var _maxdatecreateon= MAXX( FILTER(ALLSELECTED('Table'), 'Table'[PRODUCT_NAME]=MAX('Table'[PRODUCT_NAME])&&'Table'[ID]=MAX('Table'[ID])),[CHANGED_ON]) var _maxstamp= MAXX( FILTER(ALLSELECTED('Table'), 'Table'[PRODUCT_NAME]=MAX('Table'[PRODUCT_NAME])&&'Table'[ID]=MAX('Table'[ID])&&'Table'[CHANGED_ON]=_maxdatecreateon),'Table'[STAMP]) return MAXX( FILTER(ALL('Table'), 'Table'[PRODUCT_NAME]=MAX('Table'[PRODUCT_NAME])&&'Table'[ID]=MAX('Table'[ID])&&'Table'[CHANGED_ON]=_maxdatecreateon&&'Table'[STAMP]=_maxstamp),'Table'[CALL_FLAG])count of IDs = CALCULATE( DISTINCTCOUNT( 'Table'[ID]),FILTER(ALL('Table'),'Table'[PRODUCT_NAME]=MAX('Table'[PRODUCT_NAME])))2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
itsmeanuj , if you need a column you can use earlier
maxx(filter(Table, Table[ID] = earlier(Table[ID])) , Table[Date])
refer
Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
Or you can consider the following for measures
Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
- itsmeanuj3 years agoHelper IV
amitchandak - Thanks for your response. But in my scenario, we first need to take latest "changed_on" date and then latest "Stamp" date in that "Changed_on" date. Also this needs to be dynamic as there is a "changed_on" date slicer at the top of the page.