0
votes

I'm having trouble trying to obtain summary transaction header level data from my line details data.

I have sales item data with a DateTime for each row added to the table. I want to pull the min and max values of this datetime column BY EACH transaction ID.

Hoping to do this in DAX as a virtual table or measure without going to SQL server again.

Thanks for your help

Sample data.

enter image description here

Desired Result

enter image description here

1
What is your ultimate goal? To show this in a visual, a DAX calculated table, or within the query editor?Alexis Olson

1 Answers

0
votes

I you need a new table created by DAX, use this code:

NewTable = ADDCOLUMNS(
SUMMARIZE('Table','Table'[TrxID]), 
"MinDateTime", CALCULATE(min('Table'[LineDateTime])), 
"MaxDateTime", CALCULATE(max('Table'[LineDateTime]))
)