Forum Discussion

RichardT_78's avatar
RichardT_78
Icon for Helper I rankHelper I
6 years ago
Solved

Returning the latest data row

Hi All 

 

I cant find how to display duplicate data - have have seen some simple right click remove duplicate copies but i dont have these option available to me as im using a live dataset connection.This seems to limit some of the functionalites. 

 

I am looking to make a messure to differentiate data rows 

 

Robot 1      Variable 1   vairable 2     23/3/20 10:00

Robot 2      Variable 1   vairable 2      Date and time stamp

Robot 1      Variable 1   vairable 2      27/3/20 11:00

Robot 3      Variable 1   vairable 2      Date and time stamp

Robot 1      Variable 1   vairable 2      30/3/20 12:34

 

How can i use a messure to show this

Robot 1      Variable 1   vairable 2      30/3/20 12:34

Robot 2      Variable 1   vairable 2      Date and time stamp

Robot 3      Variable 1   vairable 2      Date and time stamp

 

I looked at relationships but that is greyed out.

I cant carry out this Soulution  as i cant group either.

https://community.powerbi.com/t5/Desktop/Finding-the-most-recent-date-time-for-each-row/m-p/555438#M261631

 

Can i check the robot name againt the max date ?No sure how this would look in DAX

Thanks for any help that anyone can provide. 

 

Richard 

 

 

  • Mariusz's avatar
    Mariusz
    6 years ago

    Hi RichardT_78 

     

    this Measure should work with the updated scenario.

    Measure 10 = 
    VAR __maxDate = 
        CALCULATE(
            MAX( Table[Date] ),
            ALLEXCEPT( Table, Table[Robot] )
        )
    RETURN 
    CALCULATE(
        COUNTROWS( Table ),
        TREATAS( { __maxDate }, Table[Date] )
    )

    Later you can use it in a filter pane as filters on this visual, like below.

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

4 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi RichardT_78 

     

    try this

    max date stamp = MAX( table[datetimecolumn] )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

    • RichardT_78's avatar
      RichardT_78
      Icon for Helper I rankHelper I

      No this did not work 

       

      It does'nt seem to take into account the differences in the difference in colums 

       

      E.G 

                         motor temp     Is fault light on/ off       comments     Max Date.

      Robot 1          14 deg               on                               very hot        27/3/20

      Robot 1          11 deg               on                                    hot           28/3/20

      Robot 2          3 deg                 off                                   n/a            29/3/20   

       

      Ideally i want to show item 2&3 in red only 

       

      Richard 

       

      • Mariusz's avatar
        Mariusz
        Icon for Community Champion rankCommunity Champion

        Hi RichardT_78 

         

        this Measure should work with the updated scenario.

        Measure 10 = 
        VAR __maxDate = 
            CALCULATE(
                MAX( Table[Date] ),
                ALLEXCEPT( Table, Table[Robot] )
            )
        RETURN 
        CALCULATE(
            COUNTROWS( Table ),
            TREATAS( { __maxDate }, Table[Date] )
        )

        Later you can use it in a filter pane as filters on this visual, like below.

         

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

        Please feel free to connect with me.
        LinkedIn