Forum Discussion

RobbLewz's avatar
RobbLewz
Helper II
6 years ago

Prior year Matrix column

Hi,  I have a matrix table in my report that I want to show total sales by employee, per month and have a total sales for the previous year.

 

I have a SQL

dimension called DimEmployee, (EmpId(PK), EmpName),

UK format...

dimenstion called DimDate (DateKey(PK), FullDate(DD/MM/YYY/), FiscalYear, FiscalMonth, FiscalMonthName) -- Fiscal Month is an int, (1 = April etc... used to order FidcalMonthName)  -- FiscalMonthName is a varchar, April, may, June, etc...

Fact table called FactSales(EmpId(FK), SaleAmount deciaml, DateKey(FK))

 

So I have a slicer that oulls its value from DimDate(FiscalYear) to filter the matrix to one fiscal year,

 

The Matrix visual is configured as

Rows - DimEmployee.EmpName

Columns - DimDate.FiscalMonthName

Values - FactSales.SaleAmount -(Summed from the drop down)

 

The table looks something like...

 

EmployeeAprilMay.... etcTotal (Calculated by the matrix)
Emp110203060
Emp25101025

 

 

However, we want to have a Prior Year total column at the start, so someting like....

 

EmployeePrior Year TotalAprilMay.... etc

Total(YDT)

Emp 1500202010

50

 

I can't find out, how to achive this though.

 

I have a Metrix table with 2 measures

Current year = SUM(FactSales[SalesAmount]) - filtered by the report slicer of fiscal year

Prior Year = CALCUALTE([CurrentYear], SAMEPERIODLASTYEAR(DimDate[FullDate]))

 

The values work fine in a bar chart, but I can find a way to implement it into the matrix in the format above

 

Anyone faced this issue?

4 Replies