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 filter one data and see two periods on columns?

Hello. 

 

I have two slicers, one with year and other with month (both required).

 

The idea is: When I select year and month, one colunm return the period selected and other colunm return the values from last december before selected period.

 

Example:

 

IF I selected May 2018, columns return May 2018 and December 2017;

If I select April 2016, return April 2016 and December 2015.

 

The actual values it´s ok.

 

But, when I select the period, the column Exposition Last December doesn´t work.

 

PowerBI.JPG

Can someone help me?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Meirieli,

 

I'm assuming you want MTD values:

 

Use something like this:

Exposition Last December = 
CALCULATE (
    SUM ( Table[Value] );
    FILTER (
        ALL ( Table[Date] );
        MONTH ( Table[Date] ) = 12
            && YEAR ( Table[Date] ) = ( YEAR ( MAX ( Table[Date] ) ) -1)
    )
)

 

Any questions please tell me

 

Regards

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Meirieli,

 

I'm assuming you want MTD values:

 

Use something like this:

Exposition Last December = 
CALCULATE (
    SUM ( Table[Value] );
    FILTER (
        ALL ( Table[Date] );
        MONTH ( Table[Date] ) = 12
            && YEAR ( Table[Date] ) = ( YEAR ( MAX ( Table[Date] ) ) -1)
    )
)

 

Any questions please tell me

 

Regards

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix, it´s just I need! Tks! \o/

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