Forum Discussion

zanottiluca's avatar
zanottiluca
Helper II
7 years ago
Solved

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...
  • Zubair_Muhammad's avatar
    7 years ago

    zanottiluca 

     

    try this as Calculated Table

     

    Calculated Table = 
    GENERATE (
    SELECTCOLUMNS ( VALUES ( 'Table1'[Groupid]), "Groupid_", [Groupid] ),
    CALCULATETABLE ( TOPN ( 1, 'Table1', [InvoiceN], DESC,[Modified Date],DESC ) )
    )