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
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
v-cgao-msft
Community Support
Community Support

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
v-cgao-msft
Community Support
Community Support

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

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