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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
mrdiesta
Frequent Visitor

How to get the previous year and its last month (From Current: Sept. 2023 to Dec 2022)

Good day,

I want to get the value of the last year and its last month (e.g.: current month & year is September 2023, the value will be December 2022)

mrdiesta_0-1695309516474.png

this is i did in my previous month, how can i do it to previous year & its last month (December 2022).




Thanks a lot,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mrdiesta ,

Please try:

Measure = 
VAR __current_year = YEAR(MAX('Loan Listing'[Current Date]))
VAR __pre_year = __current_year - 1
VAR __last_month = 12
RETURN
CALCULATE([WECL RATE],YEAR('Loan Listing'[Current Date])=__pre_year && MONTH('Loan Listing'[Current Date])=__last_month)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @mrdiesta ,

Please try:

Measure = 
VAR __current_year = YEAR(MAX('Loan Listing'[Current Date]))
VAR __pre_year = __current_year - 1
VAR __last_month = 12
RETURN
CALCULATE([WECL RATE],YEAR('Loan Listing'[Current Date])=__pre_year && MONTH('Loan Listing'[Current Date])=__last_month)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Thank you so much! It works 😍

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.