cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mqcp
Resolver I
Resolver I

Showing data from current month as well as a month prior in gallery labels

So I have a table with data entries for tracking product amounts month to month. One of my columns, "Month Entered", tracks when a product was added to the data table. Within my power app I have a gallery with labels as follows: Product Name, Last Month, This Month. With Last Month and This Month being the count for the month. My question is, is there some way to obtain the date of Last Month by subtracting from This Month. (i.e. This Month = February;  This Month - 1 Month = January).

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @mqcp ,

You should just need

Month(ThisItem.'This Month') - Month(ThisItem.'Last Month')

but allowing for December/January and previous years

Month(ThisItem.'This Month') - Month(ThisItem.'Last Month') + 
If(
   Year('Last Month') < Year(Today()),
   12 * (Year(Today()) - Year('Last Month'))
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @mqcp ,

You should just need

Month(ThisItem.'This Month') - Month(ThisItem.'Last Month')

but allowing for December/January and previous years

Month(ThisItem.'This Month') - Month(ThisItem.'Last Month') + 
If(
   Year('Last Month') < Year(Today()),
   12 * (Year(Today()) - Year('Last Month'))
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

WarrenBelz
Super User
Super User

Hi @mqcp ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,998)