cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meirieli Frequent Visitor
Frequent Visitor

How to select Last December Rating from current data filtered?

Hi, guys.

 

On the model below, when I aplly one filter on my column date, one column need to return the rating of current month and other about last December. When I selected actual month, the rating it´s ok. But, the column with rating from last December about actual date selected is blank. Can someone to help me with that measure? Thanks!

 

Remember that Rating it´s based on column Grupo Economico. I have only one rating for each Grupo Economico and month/year.

 

 

Duvida Rating.png

2 REPLIES 2
Super User
Super User

Re: 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


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Highlighted
Meirieli Frequent Visitor
Frequent Visitor

Re: How to select Last December Rating from current data filtered?

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).

 

Modelo.PNG

 

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.

 

 

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,834)