Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I have a date filter called ColMonth (Jan, Feb, Mar....Dec) and use it to generate a table for different months. I want to compare two months a selected one and the previous ie Select March and compare it with February.
I have tried using ColMonth = Colmonth-1 in a set analysis but it does not work, I have tried
month(makedate(ColYear, ColMonth-1)) on its own and it goes me the the month 2 but when used in a set expression it does not work,
Thanks
maybe this:
{< ColMonth = {"=Max(ColMonth)-1"} >}
I hope it helps.
Add a date field:
load Date(Monthstart(Date#(Mois,'MMM')),'DD/MM') as Date,Mois, Sales Inline [
Mois, Sales
Jan, 100
Feb, 200
Mar, 300
];
then use this measure:
sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales)
If u select Feb, u'll have the sales of Jan; if u select Mar, u'll have the sales of Feb etc:
For variation :
(sum({<Mois, Date={"$(=date((max(Date)),'DD/MM'))"}>}Sales)
-
sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales))
/
sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales)
Result: