Forum Discussion
Anonymous
7 years agoNot applicable
Trend between two selectionned dates
Hello ! I am struggling with a function i want to create. my objective is to create an indicactor which shows the trend between two selectionned dates. Thoses dates are selectionned by the user u...
- 7 years ago
Hi Anonymous,
Please refer to below measure:
trend = VAR firstdatevalue = CALCULATE ( SUM ( Sample2[Quantity] ), FILTER ( Sample2, Sample2[Date] = MIN ( Sample2[Date] ) ) ) VAR lastdatevalue = CALCULATE ( SUM ( Sample2[Quantity] ), FILTER ( Sample2, Sample2[Date] = MAX ( Sample2[Date] ) ) ) RETURN DIVIDE ( lastdatevalue - firstdatevalue, firstdatevalue )Best regards,
Yuliana Gu
Omega
7 years agoImpactful Individual
Can you share sample data and the expected results?
- Anonymous7 years agoNot applicable
Hello,
Here is a sample :
I just simplfied the number of article, in my case there more than 1000...
Thank you!
- v-yulgu-msft7 years agoMicrosoft Employee
Hi Anonymous,
Please refer to below measure:
trend = VAR firstdatevalue = CALCULATE ( SUM ( Sample2[Quantity] ), FILTER ( Sample2, Sample2[Date] = MIN ( Sample2[Date] ) ) ) VAR lastdatevalue = CALCULATE ( SUM ( Sample2[Quantity] ), FILTER ( Sample2, Sample2[Date] = MAX ( Sample2[Date] ) ) ) RETURN DIVIDE ( lastdatevalue - firstdatevalue, firstdatevalue )Best regards,
Yuliana Gu
- Anonymous7 years agoNot applicable
Hello,
It matchs perfectly my needs !
Thank you !