cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
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



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

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
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



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 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 (3,234)