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
salil
New Member

remove historical data from table

Hi, 

I am facing issue in creating Table 2 from Table 1. Table 1 has historical records for the host. I want to keep the latest row data for each host in Table 2.

 

please refer Table 1

 

HostDateStatus
Computer130/11/2022Compliant
Computer230/10/2022Non Compliant
Computer330/06/2022Compliant
Computer125/11/2022Compliant
Computer225/09/2022Compliant
Computer325/07/2022Non Compliant

 

table 2 output should be 

HostDateStatus
Computer130/11/2022Compliant
Computer230/10/2022Non Compliant
Computer325/07/2022Non Compliant

 

I am able to get the unique value for the Host column but getting the latest date and related status is showing error.

regards

Salil Singh

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @salil ,

If you want a seperate table, @amitchandak 's solution works fine. If you want a visual to display the expected result, here's my solution. Create a measure:

Measure =
IF (
    MAX ( 'Table'[Date] )
        = MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Host] = MAX ( 'Table'[Host] ) ),
            'Table'[Date]
        ),
    1,
    0
)

Put the measure in the visual filter and set to 1.

vkalyjmsft_0-1669873233097.png

After apply filter, get the correct result:

vkalyjmsft_1-1669873275533.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

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.