Forum Discussion

osama_ayoub's avatar
osama_ayoub
Helper III
3 years ago
Solved

creating measure using dax

Hi, I have a table of sales transaction with columns of product and quantity and date of sale and years of warrenty and column of date when this quantity will be out of warrenty and lastly status co...
  • tamerj1's avatar
    3 years ago

    osama_ayoub

    Since you already have a date table then no need for a Years table. Sorry for that but I did not have all the information about your data model.

    Two relationshops have to be created. One "Active" between DateTable[Date] and Query[Basic fin.] and other "Inactive" between DateTable[Date] and Query[Out of Warranty]

    The measure would be 

     

    Remaining Quanitiies of Product Still in Warrenty =
    CALCULATE (
        SUM ( 'Query'[Del. qty] ),
        'DateTable'[Year] >= MAX ( 'DateTable'[Year] ),
        USERELATIONSHIP ( 'Query'[Out of Warranty], 'DateTable'[Date] )
    )