cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors