Forum Discussion
osama_ayoub
Helper III
3 years agocreating 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...
- 3 years ago
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] ) )
tamerj1
Community Champion
3 years agoSince 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] )
)