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

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 III
Super User III

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 III
Super User III

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

rizwanmgm
Frequent Visitor

Thanks a lot

rizwanmgm
Frequent Visitor

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (48,309)