Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
YTD Variable Expression: ">=$(mindate)<=$(maxdate)"
LYTD Variable Expression: ">=$(lmindate)<=$(lmaxdate)"
lmaxdate -> =num(AddYears(MAX(DateKey),-1))
lmindate -> =num(AddYears(YearStart(max(DateKey)),-1))
I want to find Count(Customers) for YTD and LYTD in KPI.
How can I achieve the results with my above variables in place.
I have used this for No. of Customers in YTD =Count({<DateKey={$(=ytd)}>} Distinct [Customer]) and for LYTD =Count({<DateKey={$(=lytd)}>} Distinct [Customer])
I am not getting desired results.
Hi, ahve you tried without the equal sign after $(?:
=Count({<DateKey={$(ytd)}>} Distinct [Customer]).
In expression editor you can chek how the values are expanded, you can try $(mindate) to check the value it returns, doing the same with all other $( expressions to confirm they wirk as expected.
Also do a fully manual expression, converting $-expression to manually written values to make the expression work. With a working expression convert the $-expression into some some expression that returns the desired vales, in the format you need.
Maybe a date is returned with decimals or in an unexpected date format.