I have MDX query fetching last 3 months data based on customer names/previous month sales<>0. Please note to calculate previous month sales, i am using parallelperiod in cube calculation hence I keep [Dim EIS Time].[By Fiscal Year].[Period] along with customername. Executing MDX query getting results in row wise where as looking for month wise sales on column wise.
MDX query::
select
{[Measures].[Sales]} on columns,
Filter((except(
[Dim Customer].[CustomerName].[CustomerName].MEMBERS,
{[Dim Customer].[CustomerName].&[NA],[Dim Customer].[CustomerName].&[UNKNOWN]}),
LastPeriods(3,[Dim Time].[By Fiscal Year].[Period].&[Jul-21])),
abs(round([Measures].[PreviousMonthSales],6))<>0.000000) on rows from [CSIS]
Getting results::
Expected results::