Forum Discussion
How To display Latest Records for the same date
I Have the report with the many visuals and the sample data is attached below.
Here we have one file and it is loaded in to the table from excel file. everyday it is uploaded by different times. for each file we are giving batch id.
| Batch id | Date | Table Name | Successful records |
| 1 | 3/12/2019 | Landing Table | 10 |
| 2 | 3/12/2019 | Landing Table | 5 |
| 3 | 3/12/2019 | Landing Table | 6 |
| 1 | 4/12/2019 | Landing Table | 9 |
| 2 | 4/12/2019 | Landing Table | 10 |
| 1 | 5/12/2019 | Landing Table | 6 |
| 2 | 5/12/2019 | Landing Table | 4 |
| 3 | 5/12/2019 | Landing Table | 2 |
Now we are reporting this any different visuals. with the date filter. Now the user want to see the latest data for the current date.That is only the below data.
| 3 | 5/12/2019 | Landing Table | 2 |
But the user also should have the flexibility to see the other date data by using filter.
Please help me on this issue.
Hi Anonymous ,
Firstly, we need to add a indexcolumn in Power Query Editor to identify the latest rows of same day.
Then we can create a measure and use it in Visual Filter to meet your requirement:
IsLatestRecordOfMaxDay = VAR maxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) ) RETURN IF ( SELECTEDVALUE ( 'Table'[Date] ) = maxDate && SELECTEDVALUE ( 'Table'[Index] ) = CALCULATE ( MAX ( 'Table'[Index] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = maxDate ) ), 1, -1 )The date does not nessary to sort by increament, we create index column to get the latest record after filter the table with the latest day.
If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.
Best regards,
4 Replies
- Tahreem24Super User
Anonymous ,
Use the slicer with Relative option. Screen shot is attached.
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
- AnonymousNot applicable
Hi Tahreem24,
The solution that you provided is not working for me. Because here i have tye dependency with Batchid also.
For the current date the latest batchid file need to be display in the reports but in the filter we should have all the values to select.
- v-lid-msftCommunity Support
Hi Anonymous ,
Firstly, we need to add a indexcolumn in Power Query Editor to identify the latest rows of same day.
Then we can create a measure and use it in Visual Filter to meet your requirement:
IsLatestRecordOfMaxDay = VAR maxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) ) RETURN IF ( SELECTEDVALUE ( 'Table'[Date] ) = maxDate && SELECTEDVALUE ( 'Table'[Index] ) = CALCULATE ( MAX ( 'Table'[Index] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = maxDate ) ), 1, -1 )The date does not nessary to sort by increament, we create index column to get the latest record after filter the table with the latest day.
If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.
Best regards,
- v-lid-msftCommunity Support
Hi Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,