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

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

Accepted Solutions
Highlighted
Super User
Super User

Re: How to filter one data and see two periods on columns?

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

MFelix


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

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: How to filter one data and see two periods on columns?

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

MFelix


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

Proud to be a Datanaut!




View solution in original post

Meirieli Frequent Visitor
Frequent Visitor

Re: How to filter one data and see two periods on columns?

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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)