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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Luis_Caston
Helper III
Helper III

Calendar Campaings

Dear all,

I'm focused to get a calendar campaing to filter time periods ranges.

Campaigns:

  1. Cherry Winter:
    1. Months: 9,10,11,12,1,2,3.
      1. So as you can check is goingh throug two years:
        Start Year: months 9,10,11,12.
        Next year from Start Year: months 1,2,3.
        So imagine if my date picker is at this range:
        Luis_Caston_0-1709635904044.png

        If I select Cherry winter the date picker must change to:

        Luis_Caston_3-1709636323477.png

         

  2. Cherry Summer:
    1. Months: 4,5,6,7
    2. Year: first year of the Date Picker.
    3. So if Date Picker is filteres as follows:
      Luis_Caston_1-1709636000558.png

       

    4. If I select Cherry Sumer must change to the next range:
      Luis_Caston_2-1709636057562.png

I' ve testing creating a column at the calendar table by campaing that is to say, one column Cherry Summer, another one Cherry Winter but I don't know if I'm following the correct way.

 

Do you have an idea?

I add the pbix to work with: Calendarv4 

6 REPLIES 6
JamesFR06
Resolver IV
Resolver IV

ok I have changed your formula

test =

var _selecteyear = Calendario[Year]
RETURN

IF (
AND ( Calendario[NumMonth] IN { 4, 5, 6, 7 },  Calendario[Year] = _selecteyear),
"Cherry Summer"&" "&_selecteyear,
IF (
OR (
AND ( Calendario[NumMonth] IN { 1, 2, 3 },  Calendario[Year] = _selecteyear+1),
AND ( Calendario[NumMonth] IN { 9, 10, 11, 12 },  Calendario[Year] = _selecteyear)
),
"Cherry Winter"&" "&_selecteyear
)
)

Hi @JamesFR06 !
Again thank you!
Now when I select one year at the filter appears the campaings related to the year - what is easy to manage - but the problem is that the campaing that start one year and rolling up to the next one is stuck at the year that you have selectec, that is to say if you select 2.023 at the year filter the campaing that goes from months 9,10,11,12 from 2.023 and continuos to the months 1,2,3 of 2.024 remains stuck at 31.12.23.

Luis_Caston_0-1709712909561.png

 

I add the pbix: CalendarV4 

JamesFR06
Resolver IV
Resolver IV

Hi Luis_Caston

 

I've created a new column

test =
IF (
AND ( Calendario[NumMonth] IN { 4, 5, 6, 7 }, Calendario[Year] = 2023 ),
"Cherry Summer",
IF (
OR (
AND ( Calendario[NumMonth] IN { 1, 2, 3 }, Calendario[Year] = 2024 ),
AND ( Calendario[NumMonth] IN { 9, 10, 11, 12 }, Calendario[Year] = 2023 )
),
"Cherry Winter"
)
)

 

After on ly side it works when I choose winter or summer choice

Hi @JamesFR06 !!

Good idea!!!

That's exactly what I'm looking for becasue changes the Date Picker.
One thing do you know how can I make it dynamic? Because now years are fixed.

I'm thinking to add for example a Year filter and replace your formula as follows:

Luis_Caston_0-1709642432017.png

 

test =
IF (
AND ( Calendario[NumMonth] IN { 4, 5, 6, 7 }, Calendario[Year] = Calendario[Year]),//because I've filtered by 2023
"Cherry Summer",
IF (
OR (
AND ( Calendario[NumMonth] IN { 1, 2, 3 }, Calendario[Year] =  Calendario[Year]+1),//because I've filtered by 2023
AND ( Calendario[NumMonth] IN { 9, 10, 11, 12 }, Calendario[Year] = Calendario[Year] )//because I've filtered by 2023
),
"Cherry Winter"
)
)

If I select for example 2.022 would be 2.022 as year and 2.023 year +1.
But my formula doesn´t works.
Just in case link to the pbix: Calendarv4 

Luis

 

In your formula I do not see where you store the value of your year choice.

So try

SelectedYear=Selectedvalue(Calendario[Year])

 

and after in your formula for exemple change as below :

Instead of :

AND ( Calendario[NumMonth] IN { 1, 2, 3 }, Calendario[Year] =  Calendario[Year]+1)

Make this

AND ( Calendario[NumMonth] IN { 1, 2, 3 }, Calendario[Year] =  SelectedYear+1)

HI @JamesFR06 
I've made this but the options dissepear:

"var _selecteyear = SELECTEDVALUE(Calendario[Year])"
after the RETURN:

AND ( Calendario[NumMonth] IN { 4, 5, 6, 7 },  Calendario[Year] = _selecteyear)
 
AND ( Calendario[NumMonth] IN { 1, 2, 3 },  Calendario[Year] = _selecteyear+1)
AND ( Calendario[NumMonth] IN { 9, 10, 11, 12 },  Calendario[Year] = _selecteyear)
 




Luis_Caston_0-1709646556391.png

 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors