Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an expression for total payments :
(Sum({<Account={'2000','2001','2002','2003'}>}Trans))*-1
How would I create a measure for % increase in payments from previous month?
I want this to be rolling dates as I load new data every month. So I want...(total for last month-total for current month)/ Total for last month).
Do this in the script to create a new field and then use that as your filter.
Date(MonthStart(TransactionDate), 'MMMM YYYY') as MonthYear
and then use this expression
Sum({<Account = {'2000','2001','2002','2003'}, TransactionDate = {"$(='>=' & Date(MonthStart(Max(TransactionDate)), 'MM/DD/YYYY') & '<' & Date(MonthStart(Max(TransactionDate), 1), 'MM/DD/YYYY'))"}, MonthYear>}Trans)/
Sum({<Account = {'2000','2001','2002','2003'}, TransactionDate = {"$(='>=' & Date(MonthStart(Max(TransactionDate), -1), 'MM/DD/YYYY') & '<' & Date(MonthStart(Max(TransactionDate)), 'MM/DD/YYYY'))"}, MonthYear>}Trans) - 1
Is this in a chart where Month or MonthYear is a dimension? If it is, then try this may be
Sum({<Account={'2000','2001','2002','2003'}>}Trans)/Above(Sum({<Account={'2000','2001','2002','2003'}>}Trans)) - 1
No I want to display it as a KPI at the top of a sheet above other charts. I have a dimension for month year...and I would like it to update with those selections. The date field is called 'TransactionDate'.
So, you would want to compare the max(MonthYear) to its previous? or compare today's month to its previous?
Today's month or max month, to previous month (same year).
But I would also like the option to compare to same month (previous year). Could you do both?
You sure can, it will just help to know what date and time related fields do you have and what are there formats
The date field is 'TransactionDate' fomat 'mm/dd/yyyy'
May be try this
Sum({<Account = {'2000','2001','2002','2003'}, TransactionDate = {"$(='>=' & Date(MonthStart(Max(TransactionDate)), 'MM/DD/YYYY') & '<' & Date(MonthStart(Max(TransactionDate), 1), 'MM/DD/YYYY'))"}>}Trans)/
Above(Sum({<Account = {'2000','2001','2002','2003'}, TransactionDate = {"$(='>=' & Date(MonthStart(Max(TransactionDate), -1), 'MM/DD/YYYY') & '<' & Date(MonthStart(Max(TransactionDate)), 'MM/DD/YYYY'))"}>}Trans)) - 1
It gives me NULL
Would you be able to provide a sample?