DAX - Last Value

You have to create two measures. One for the last time in each date and another to get the value for that date and time.

Last Time := 
CALCULATE(MAX([Time]),FILTER('Table',[Date]=MAX([Date])))

Last Traded Value =
    CALCULATE (
        MAX ( 'Table'[Traded Value] ),
        FILTER ( 'Table', [Date] = MAX ( [Date] ) && [Last Time] = [Time] )
    )

Then add Date column to rows and Last Time and Last Traded Value measures to Values pane in a pivot table.

Let me know if this helps.


For example:

DEFINE
VAR TableTMP =
    ADDCOLUMNS ( 'Table', "DateTime", [Date] + [Time] )
EVALUATE
    SUMMARIZE (
      NATURALINNERJOIN (
        TableTMP,
        SUMMARIZE  (
          GROUPBY ( TableTMP, [Date], "DateTime", MAXX ( CURRENTGROUP (), [DateTime] ) ),
          [DateTime]
        )
      ),
      [Date],
      [Time],
      [Traded Value]
    )

Tags:

Powerpivot

Dax