Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello Community,
Can you please help me writing a following DAX Column . I have following calculated column which identify previous product by Date . I need it by Year.
Customer ID | DATE | Product | Previous Product
1 1/Jan/2020 A -
1 2/ Feb/ 2020 B A
1 13 / Jan/ 2021 B -
1 14 / Feb/ 2021 A B
I tried using folloing formula but it is by date : I need it by year
Solved! Go to Solution.
@Anonymous sorry my bad, try this
_prevProd = calculate(max('Table'[Product]),FILTER('Table','Table'[CustID]=EARLIER('Table'[CustID])&&'Table'[_year]=EARLIER('Table'[_year])&&'Table'[Date]<EARLIER('Table'[Date])))
@Anonymous try this
_prevProd = MINX(FILTER('Table','Table'[CustID]=EARLIER('Table'[CustID])&&'Table'[_year]=EARLIER('Table'[_year])&&'Table'[Date]<EARLIER('Table'[Date])),'Table'[Product])
Hi @smpa01 ,
Thankyou so much for the reply.
I am looking continuous previous product. The code you send is producing only first previous product in year.
@Anonymous sorry my bad, try this
_prevProd = calculate(max('Table'[Product]),FILTER('Table','Table'[CustID]=EARLIER('Table'[CustID])&&'Table'[_year]=EARLIER('Table'[_year])&&'Table'[Date]<EARLIER('Table'[Date])))
User | Count |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |