Forum Discussion
How to select Last December Rating from current data filtered?
Well, no source data, no formulas posted, no table or table relationships but what the heck, I'll give it a shot. I would think that what you need to do is change your filter context, so something like:
MAXX(FILTER(ALL(Table),[Month]="December" && [Year] = YEAR(TODAY())-1),[something])
But who knows really provided the given information, I can only guess with regards to tables, columns, etc.. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Oh, really! I´m sorry.
It's my fault.
My model it´s based on four tables, as below.
DataBase (Date), RiscoOperacaoFinal (Column Rating), Cliente(Column Grupo Economico) and Carteira(fact Portfolio).
The Column Rating It's like a good payer rating.
The closer to A, the better paying.
In my model, I need two columns:
1 - select the classification Column Rating of customer based on data filter - year and month;
2 - the classification Column Rating of customer based on last December about current selected date.
Example:
If I select April 2018, on column 1 a return the classification about that period and on column 2 a return the rating about December 2017.
If I select May 2017, on column 1 a return the classification about that period and on column 2 a return the rating about December 2016.
My actual DAX code from Column 1 is:
Provisao Mes Atual =
VAR Tbl2 =
SUMMARIZE (
FILTER (
Carteira;
Carteira[nr Ano Mes]
= IF (
ISFILTERED ( 'Data Base'[ano] ) && ISFILTERED ( 'Data Base'[nome Mes] );
Carteira[nr Ano Mes];
BLANK ()
)
);
'Risco Operacao Final'[cdRiscoNivel];
"Provisao"; [ProvisaoTotal]
)
RETURN
MAXX ( Tbl2; [Provisao] )
RETURN
MAXX(Tbl2;[Provisao])
From column 2 that code doesn´t work.
I hope this time I have been more clear and objective.
Right away, thank you.