I'll try to answer this question based on my understanding of what you have written.
1. Open up the monthdata field into month and year. append 01 as the date and concatenate all the three, so that you can get a new date field.
so 022019 --> 01-02-2019.
2. Now create a new calculated field ,which picks up the max of the dates just created.
3. Create a Boolean field , max date = mondthdata calculated field (from step 1), pull it into the filters and select True.
4. Now drag the calculated field from step 1, show relevant values, you should always get the max field.
Hope it helps.
Do correct me if I am wrong.
Mark it as the "Correct Answer", so others may find it useful.
Data exist till 022019 (Feb 2019) after the next refresh data may exist till march 2019.
I am showing YTD logic where if user selects jan then i need to jan data if users selects Mar then i need to show jan+Feb+mar data for these logic i have created a month parameter and showing.
After every refresh i am checking the parameter manually whether data is coming for the next month and based on the data availability i am keeping that month and publishing .
Can i check the same automatically and change the month name automatically is this possible.