cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rizwanmgm
Helper I
Helper I

Display current and previous month in current year

Dear Experts,

 

I want to show current and previous months for current year in dropdownlist, i try the below formula but it is showing 12 months

ForAll(Sequence(13),Text(DateAdd(Today(),-Value+1,Months),"[$-en-US]mm"))

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @rizwanmgm 

This should return what you're looking for by returning the dropdown values 1-4.

 

Filter(ForAll(Sequence(12),Text(Date(Year(Now()), Value, 01),"[$-en-US]mm")),
       Value(Value) <= Month(Now())
)

 

This will show the 3 character month name instead:

Filter(ForAll(Sequence(12),Text(Date(Year(Now()), Value, 01),"[$-en-US]mmm")),
       Value(Value) <= Month(Now())
)

View solution in original post

3 REPLIES 3
timl
Super User
Super User

Hi @rizwanmgm 

This should return what you're looking for by returning the dropdown values 1-4.

 

Filter(ForAll(Sequence(12),Text(Date(Year(Now()), Value, 01),"[$-en-US]mm")),
       Value(Value) <= Month(Now())
)

 

This will show the 3 character month name instead:

Filter(ForAll(Sequence(12),Text(Date(Year(Now()), Value, 01),"[$-en-US]mmm")),
       Value(Value) <= Month(Now())
)

Thanks a lot

Dear Expert,

 

I have a variable which gets the months as below

Set(varMonths,
Filter(ForAll(Sequence(12),Text(Date(Year(Now()), Value, 01),"[$-en-US]mm")),
Value(Value) <= Month(Now())
)
);

I bind the variable to dropdownlist items, how to show the months in for ex January, 01 format in dropdown list.

 

Thanks

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,582)