Forum Discussion

SBethell's avatar
SBethell
Regular Visitor
3 years ago

Dynamically Calculating minimum value

I'm trying to visualise the movement of applications thorugh our system, using a dataset that produces a record for every interaction that the application has had with our system, but I only want to be counting the most recent interaction.

Column 4 in the image attached is what I need to get to, showing the smallest number grouped by application, where the Rel Date is at least 6, and at most 100. 

 

8 Replies

  • SBethell's avatar
    SBethell
    Regular Visitor

    Not sure what exactly you're asking for but in the image above I need to be able to select only the most recent interaction each application has, in the example above I only want to be  counting record 3 for application A, and record 2 for application B. I'm currently using:

    CALCULATE(MIN(Table[LatestRecord]),ALLEXCEPT(Table,Table[AppID],Table[Rel Date]))
    This works when there are no filters on relative date, however when I use a slicer to change the available relatives dates it stops working, and shows each record as the value. If I take out the Table[Rel Date] from the function, it always shows the final record regardless of the relative date.
    • tamerj1's avatar
      tamerj1
      Community Champion

      SBethell 

      Please try the following measure 

      =
      CALCULATE (
      MIN ( Table[LatestRecord] ),
      ALLSELECTED ( 'Table' ),
      VALUES ( 'Table'[AppID] )
      )

      • SBethell's avatar
        SBethell
        Regular Visitor

        Just tried it and I'm still getting the same issue where it works for when I have nothing on my slicer but as soon as I adjust the slicer, even if it doesn't impact the application I'm using as a test it shows each record as the minimum again.