Forum Discussion
Create static table from existing table
- 3 years ago
Hi Anonymous
It depends. But based on the example that you have provided this should work.New Table = TOPN ( 1, 'Table', 'Table'[Week] )However, the real data might be have different scenarios/requirements. For example if the last week for red is 3, what result shall be expected? Is it the last record for each Competitor independently or only the records of the very last week? The above solution conforms with the 2nd assumption. If the first assumption is true then you may try
New Table = GENERATE ( SUMMARIZE ( 'Table', 'Table'[Article], 'Table'[Competitor] ), VAR LastRecord = TOPN ( 1, 'Table', 'Table'[Week] ) VAR Week = MAXX ( LastRecord, 'Table'[Week] ) VAR Value = MAXX ( LastRecord, 'Table'[Value] ) RETURN ROW ( "Week", Week, "Vale", Value ) )
Hi Anonymous
It depends. But based on the example that you have provided this should work.
New Table =
TOPN ( 1, 'Table', 'Table'[Week] )
However, the real data might be have different scenarios/requirements. For example if the last week for red is 3, what result shall be expected? Is it the last record for each Competitor independently or only the records of the very last week? The above solution conforms with the 2nd assumption. If the first assumption is true then you may try
New Table =
GENERATE (
SUMMARIZE ( 'Table', 'Table'[Article], 'Table'[Competitor] ),
VAR LastRecord =
TOPN ( 1, 'Table', 'Table'[Week] )
VAR Week =
MAXX ( LastRecord, 'Table'[Week] )
VAR Value =
MAXX ( LastRecord, 'Table'[Value] )
RETURN
ROW ( "Week", Week, "Vale", Value )
)Hi Tamerj1,
Thanks for your reply!
New Table = TOPN ( 1, 'Table', 'Table'[Week] )
This seemed to be very helpful! I think I can work my way out with this. 🙂