Forum Discussion

ganchevd's avatar
ganchevd
Icon for Helper I rankHelper I
8 years ago
Solved

Defining overdues towards a dynamic filtered date

Dear All,   I had stuck with this. Since I'm a Financial guy not an SQL expert. I have built a report for Account Receivables where I have the following columns: 1. Customer; 2. Document Number; ...
  • Eric_Zhang's avatar
    Eric_Zhang
    8 years ago

    ganchevd

    In order to get a dynamic date ,you can create a calendar table with the DAX below:

     

     

    calendar =
    CALENDAR ( MIN ( 'sample'[due date] ), MAX ( 'sample'[due date] ) )

     

     

    Then create two more measures

     

     

    selected date =
    IF ( HASONEVALUE ( 'calendar'[date] ), MAX ( 'calendar'[date] ), TODAY () )
    

     

    state =
    IF ( 'calendar'[selected date] > MAX ( 'sample'[due date] ), "overdue", "ok" )

     

     

  • ganchevd's avatar
    ganchevd
    8 years ago

    Eric_Zhang

     

    Thank you! It seems quite easy. But now I lost the Customers names. When I add the Status column in the visual table, the customers names disapear and the status is either OK or Overdue to all of the entries.