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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.