Filters for slicer and for visual

Hi all,

I hope you all are well.
I would like to kindly ask for your help.

I have struggled with creating filters for my report:
Leavers_forum .pbix (430.4 KB)
Leavers_forum .xlsx (536.4 KB)

  1. Filter for visual to display data only for 12 last complete financial periods ( Today is 17/05/23 and this is the middle of Period 11 so this period is still open and not complete)

  1. This slicer should show only financial complete periods and the last complete financial period is Period 10, What should I do to remove other incomplete periods (Periods 11 and 12)
    image

Would you please guide me on how I should achieve my targets?

Grateful as always

Iwona

HI @Iwona

The simplest way to do this is to have a column in the date table marking dates prior to current period.

Assuming your data is real time ish then we can work with today and add the following column to the Calendar

IsBeforeCurrentPeriod = 

Var BeginningOfPeriod = Date(Year(today()),Month(today()),1)
Return
    IF('Calendar'[Date]<BeginningOfPeriod,1,0)

Then bring this column into the visual filter and filter for 1.

An alternative solution which will offer date flexibility across the whole solution and make time intelligence easier is to have a period offset column reading 0 for current month, -1 for last month, -2 for 2 months ago, 1 for next month etc.

@Melissa 's date table in power query offers this but I’m not sure whether it works the year offset through for non-calendar year.

Extended Date Table (Power Query M function) - Power Query / M Code Showcase - Enterprise DNA Forum

Cheers
Pete

1 Like

Leavers_forum .pbix (411.5 KB)
I was playing around, and did what Pete suggested, without knowing he suggested it :slight_smile: I basically produced a calculated column for the last 12 periods fnot including the current period, and added it as a filter to the slicer visual to restrict it, exactly what Peter said.

You would have to play around with the date math to get exactly what you wanted.

Hello @Iwona

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

Hi @kylie.oconnell ,

Grateful for your time and support.
Leavers_forum .pbix (412.1 KB)

Trying to modify your measure because I need to show all completed periods available in the slicers not only 12 of them ( like below)

Could you please help to get it right?

Many thanks,

Iwona

Leavers_forum .pbix (411.7 KB)
You just need to adjust the calculated column for the requirement, I have changed the column to all periods before the current period, based off todays date, the column should show 1 for completed periods, it is this column that is used in the filter in the slice to only show values with 1, the same would apply to any visual you wanted to filter to only previous periods.

Hello @Iwona

Good to see that you are having progress with your inquiry.
Thanks, @BINavPete and @kylie.oconnell for providing solutions.

Did the responses above help solve your query?

If it does, kindly mark the answer as the Solution to your query.

If not, how far did you get and what kind of help do you need further?

Hello @Iwona

We’ve noticed that no response was received from you on the post above.

Just following up if the response above help you solve your inquiry.
If it did, please mark his answer as the SOLUTION.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.