Forum Discussion
zanottiluca
7 years agoHelper II
Retrieve last record based on 2 sortings
Hi guys, I am struggling with a DAX computation: in brief I would like to retrieve the latest record in a group by two sorting order. The first is based on the Invoice number descending, but if wit...
- 7 years ago
try this as Calculated Table
Calculated Table = GENERATE ( SELECTCOLUMNS ( VALUES ( 'Table1'[Groupid]), "Groupid_", [Groupid] ), CALCULATETABLE ( TOPN ( 1, 'Table1', [InvoiceN], DESC,[Modified Date],DESC ) ) )
Zubair_Muhammad
7 years agoCommunity Champion
try this as Calculated Table
Calculated Table = GENERATE ( SELECTCOLUMNS ( VALUES ( 'Table1'[Groupid]), "Groupid_", [Groupid] ), CALCULATETABLE ( TOPN ( 1, 'Table1', [InvoiceN], DESC,[Modified Date],DESC ) ) )
- zanottiluca7 years agoHelper II
Hi,
Zubair_Muhammad . many thanks for this it worked and you opened a new "world" about calculated tables.
Many thanks for this
Luca
Zubair_Muhammad wrote:try this as Calculated Table
Calculated Table = GENERATE ( SELECTCOLUMNS ( VALUES ( 'Table1'[Groupid]), "Groupid_", [Groupid] ), CALCULATETABLE ( TOPN ( 1, 'Table1', [InvoiceN], DESC,[Modified Date],DESC ) ) )
Zubair_Muhammad wrote: