Forum Discussion

Jeremyh's avatar
Jeremyh
Frequent Visitor
3 years ago
Solved

DAX: Days Between Today and specific Transaction Date Not Calculating Correctly

I Have a two Tables, Table1 contains 1 record per Consignment (order) and Table 2 which contains many Scan Transactions with a Branch (Location) and Scan Date.     I Need help fixing my DAX ...
  • danextian's avatar
    3 years ago

     

    Hi Jeremyh,

     

    You can use ALLEXCEPT to aggregate rows based on an item in a column. Try something like this:

    =
    DATEDIFF (
        CALCULATE (
            MIN ( 'table'[date] ),
            ALLEXCEPT ( 'table', 'table'[consignment number] )
        ),
        TODAY (),
        DAY
    )