Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i am trying to show annual promotion count in KPI graph. If nothing is selected, graph should show YTD stats, else the number should be updated as per the fiscal year selected.
The below code shows the YTD stats but doesn't show the stats as per filter selection:
=if(
GetSelectedCount([Promotion_dt.Fisc.Year])=0,
Count(Distinct if(Promotion_dt>=AddMonths(date(yearstart(today(),0,7)),0),Emp_No)),
count(distinct Emp_No)
)
When nothing is selected YTD, correct YTD number is returned
On filter selection, this becomes 'Zero'
The below code shows the stats as per filter selection, but count the whole employee base when nothing is selected:
=if(Promotion_dt>=AddMonths(date(yearstart(today(),0,7)),0) ,count(distinct Emp_No),count(distinct Emp_No))
Nothing selected, so number should be 160 for YTD promotions
Working fine for filter selections
Try this
Count(Distinct
If(
GetSelectedCount([Promotion_dt.Fisc.Year])=0,
If(Promotion_dt>=AddMonths(date(yearstart(today(),0,7)),0), Emp_No),
Emp_No
)
)
Thank you for your response but its still same. KPI visual doesn't update with filter selection
Hi, try this
I have found the solution, GetSelectedCount wasn't working with the formula being used behind the filter to limit values to past 4 years. I was using below formula:
IF(Promotion_dt>=AddYears(date(yearstart(today(),0,7)),-3),[Promotion_dt.Fisc.Year])
If i use only
Promotion_dt.Fisc.Year, it works
If anyone can please explain why it doesn't work and can I limit the values shown in filter without effecting the functionality of GetSelectedCount(), i'll be greatful