Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
When trying to create a KPI for Previous Month the below Script is not working.
Its Just giving me the total overall.
if(VConceptType=1,
Sum({< Month = {"=Month(AddMonths(Today(),-1))"}>}[Judgment Total]),
If(VConceptType=2,
Count({< Month = {"=Month(AddMonths(Today(),-1))"}>}distinct[Judge ID]),
If(VConceptType=3,
sum({< Month = {"=Month(AddMonths(Today(),-1))"}>}[Total Earnings]))))
Any Ideas?
Regards,
Jamie
Hi @jamiemcc , I suppose VConceptType is a variable you are using to select which calculation to run. I think the solution could be using $(VConceptType) instead.
JG
Hi JuanGerardo,
Same Issue - Both Solutions Work.
The Issue seems to be here -
Month = {"=Month(AddMonths(Today(),-1))"}
Regards,
Jamie
Then I guess this can be caused because of the date format. You can try something like this, depending on your default date format and the way you calculate your Month dimension:
Month = {'=Num(Month(AddMonths(Today(),-1)))'}
Month = {"=Date(Month(AddMonths(Today(),-1)), 'MMM')"}
JG