Hi all,
I am currently working on a chart showin growth of current period (MTD, QTD, YTD, L3M, L6M...) vs previous period by month.
I will use MTD as an example, the expression of growth will look like this:
IF(SELECTEDVALUE(Filter1[Period1])="MTD",
(TOTALMTD(SUMX(FILTER(Raw1,Raw1[Level]="Item"),Raw1[Volume/Value]),'Calendar'[Date])-
CALCULATE(TOTALMTD(SUMX(FILTER(Raw1,Raw1[Level]="Item"),Raw1[Volume/Value]),'Calendar'[Date]),DATEADD('Calendar'[Date],-1,MONTH)))/
CALCULATE(TOTALMTD(SUMX(FILTER(Raw1,Raw1[Level]="Item"),Raw1[Volume/Value]),'Calendar'[Date]),DATEADD('Calendar'[Date],-1,MONTH))
In short, it's calculating (value MTD - value LMTD)/value LMTD
Then I want to show this value by month, the month value should be corresponding to the period I select. (i.e. if I select "MTD", then it should only show the value of latest month; If I select "L6M", it will show 6 months ago till the latest month) So I use Raw1[Month] as the axis instead of the 'Calendar'[Month] in master calendar.
After I put everything in the chart, the chart becomes empty.
+-Growth MTD vs LMTD Tracking data I tracked the data used for this particular visual and the value for "Total" is exactly what I am expecting.
The ideal chart will be showing Sep only with -0.0282 as the bar value.
Then for another KPI of difference between current period and previous period, the chart is showing months of both current period and previous period.
The expression for difference between current L3M and prev L3M will be:
IF(SELECTEDVALUE(Filter1[Period1])="L3M",
CALCULATE(SUMX(FILTER(Raw1,Raw1[Level]="Item"&&Raw1[CDESC]="Total Thailand"),Raw1[Volume/Value]),DATESBETWEEN('Calendar'[Date],[L3M Start],[PeriodEnd]))-
CALCULATE(SUMX(FILTER(Raw1,Raw1[Level]="Item"&&Raw1[CDESC]="Total Thailand"),Raw1[Volume/Value]),DATESBETWEEN('Calendar'[Date],[L6M Start],[L3M Start]-1))
L3M current vs L3M previousTracking Data The snapshots are for L3M chart and its tracking data.
Based on the 2 scenarios above, I would like to ask for help on how to obtain a proper comparison result shown in a proper range of months.
The ideal chart should be showing JUL - SEP only with some difference...
It would be great if anyone could help me. Thanks so much!
Best Regards,
Yoki