Forum Discussion
Pmike
8 years agoAdvocate I
Creating New Table by Summarizing rows based on Latest Date
I have the following question on creating a new table. My table consists of the following example: CURRENT TABLE Customer Date Image A 10/1/2017 Image 1 ...
- 8 years ago
If you want a calculated table. Try this.
Go to modelling tab...Press "New Table"New Table = ADDCOLUMNS ( SUMMARIZE ( CurrentTable, CurrentTable[Customer], "Max Date", MAX ( CurrentTable[Date] ) ), "Image", CALCULATE ( SELECTEDVALUE ( CurrentTable[Image] ), FILTER ( CurrentTable, CurrentTable[Date] = [Max Date] && CurrentTable[Customer] = EARLIER ( CurrentTable[Customer] ) ) ) )
parry2k
8 years agoSuper User
Add a column using following expression to flag the most recent record and then filter on that
Recent = var r = RANKX(FILTER(Image, Image[Customer] = EARLIER(Image[Customer])), Image[Date], , DESC, DENSE) return if(r = 1, "Yes", "")
- Zubair_Muhammad8 years agoCommunity Champion
If you want a calculated table. Try this.
Go to modelling tab...Press "New Table"New Table = ADDCOLUMNS ( SUMMARIZE ( CurrentTable, CurrentTable[Customer], "Max Date", MAX ( CurrentTable[Date] ) ), "Image", CALCULATE ( SELECTEDVALUE ( CurrentTable[Image] ), FILTER ( CurrentTable, CurrentTable[Date] = [Max Date] && CurrentTable[Customer] = EARLIER ( CurrentTable[Customer] ) ) ) )- Pmike8 years agoAdvocate I
Thanks Zubair, this was exactly what I was looking to accomplish.