Forum Discussion

lukasjar's avatar
lukasjar
Resolver I
6 years ago
Solved

Value from max date

Hello Community. I am trying to retrieve the TagId at Max EventRaised for each MachineID in a Direct Query.   From the picture below. 31207 = Press.31207.Störning1Utast1 Kit_Pack1 = KITLinan.Pac...
  • Anonymous's avatar
    Anonymous
    6 years ago

    share your pbix.

     

    and where are you adding this query

     

    select A.* from dbo.events a
    left join (select MachineID,max(EventRaised) _EVENT from dbo.[events]
    Group by MachineID) b ON A.MachineID=B.MachineID AND a.EventRaised=B._EVENT
    WHERE b._EVENT IS NOT NULL

     

    Get Data->Select Sql server -> ENter server name  & database name->DirectQuery Mode-> Click on advance -> paste this query there ->

    And load your data.

     

    this will give you direct result set 

     

    Thanks & regards,
    Pravin Wattamwar
    www.linkedin.com/in/pravin-p-wattamwar

    If I resolve your problem Mark it as a solution and give kudos.