Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Meirieli
New Member

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
Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors