Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 DateTable NameSuccessful records
13/12/2019Landing Table10
23/12/2019Landing Table5
33/12/2019Landing Table6
14/12/2019Landing Table9
24/12/2019Landing Table10
15/12/2019Landing Table6
25/12/2019Landing Table4
35/12/2019Landing Table2

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.

35/12/2019Landing Table2

But the user also should have the flexibility to see the other date data by using filter.

 

Please help me on this issue.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Firstly, we need to add a indexcolumn in Power Query Editor to identify the latest rows of same day.

 

6.jpg

 

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.

 

7.jpg8.jpg

 


If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lid-msft
Community Support
Community 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,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tahreem24
Super User
Super User

@Anonymous ,

 

Use the slicer with Relative option. Screen shot is attached.

 

Capture.JPG

Don't forget to hit Thumbs up and accept this as a solution if you find it helpful! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not 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.

Hi @Anonymous ,

 

Firstly, we need to add a indexcolumn in Power Query Editor to identify the latest rows of same day.

 

6.jpg

 

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.

 

7.jpg8.jpg

 


If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.