Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Return Latest Date

Hi all,

 

 

I have two tables. Location & Monitoring Date. I need to display the latest monitoring date of each location.

 

I was able to do it using the Latest function in PBI.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


But I also need to have it in the separate column. I tried using the MAX function but it returns the MAX date for all the Location. Expected output should be like the Latest Monitoring Date.

 

See photo:




 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

My expected output should be like the Latest Date Monitoring.

 

Thank you!

  • HI Anonymous

     

    You might be able to solve it using a calculated measure.

     

    This might be close.  Jsut replace the Table4 with your own tablename

     

    Measure = 
        CALCULATE(
            LASTDATE(
                'Table4'[Latest Monitoring_Date]),
                ALLEXCEPT(Table4,Table4[LocCode]
                    )
                    )

3 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    HI Anonymous

     

    You might be able to solve it using a calculated measure.

     

    This might be close.  Jsut replace the Table4 with your own tablename

     

    Measure = 
        CALCULATE(
            LASTDATE(
                'Table4'[Latest Monitoring_Date]),
                ALLEXCEPT(Table4,Table4[LocCode]
                    )
                    )
  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi  Anonymous,

     

    Have you solved your problem with the solution provided by Phil_Seamark

     

    If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please share some sample data to reproduce the scenario.

     

    Best Regards,

    Cherry

  • What if LASTDATE is not supported because of DirectQuery Data ?