Forum Discussion

agouveia's avatar
agouveia
Frequent Visitor
3 years ago
Solved

Crossjoin with filters and unique date values

Hello,   I'm looking into creating a report that is able to take snapshots of past data and show how it looked liked at a certain past date.  I have access to the history of the data but I need to...
  • johnt75's avatar
    3 years ago

    You can use

    New table =
    GENERATE(
    	VALUES( 'Calendar'[Date] ),
    	SELECTCOLUMNS(
    		INDEX(
    			1,
    			FILTER(
    				ALL( 'Card History' ),
    				'Card History'[Date] <= 'Calendar'[Date]
    			),
    			ORDERBY( 'Card History'[Date], DESC ),
    			PARTITIONBY( 'Card History'[Id] ),
    			MATCHBY( 'Card History'[Id], 'Card History'[Date] )
    		),
    		"Id", 'Card History'[Id],
    		"Status", 'Card History'[Status]
    	)
    )