Forum Discussion

Rbakker888's avatar
Rbakker888
Helper II
1 year ago
Solved

Creating an enddate based on total months active

Hi I am trying to find a way to make an end date based on a value I have in another table, I cant get it to reference it in the DAX query tho and since I havent really seen anyone else do this I came...
  • timalbers's avatar
    timalbers
    1 year ago

    Well, actually the MAX should not be crucial, as you said that for every order all the products in the table have the same data except for the sell price. So basically you could also take MIN() instead of MAX(), it should not matter at all.

    CALCULATE(
        MAX( Orderinformatie[Hoeveelheid] ), 
        FILTER( Orderinformatie, Orderinformatie[OrderID] = Orders[OrderID] )
    )

    This statement filters the Orderinformatie table down to the exact orderID for every row in the order table. Out of this subset of products from a unique orderID it takes the MAX value of Hoeveelheid. It could as well take the MIN value - should not matter as a single order should havethe same value for each product.