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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
admin11
Memorable Member
Memorable Member

How to modify EXP expression to get Last Year Amount ?

Hi All

 

I have below expression sales amount , it will plot current year :-

SALES_ = SUM(SALES[sales])

 

Below expression will plot last year sales amount :-

SALES_LY = CALCULATE( SUM(SALES[sales]), DATEADD('Date'[Date], -1, YEAR))

 

i will get chart look like below :-

admin11_0-1621600352509.png


Now i have expression for Exp Amount , it can plot current year exp amount :-

AMOUNT_EXP_ =
CALCULATE(
SUM(GL[AMT])*1,
FILTER(
GL,
GL[1_EXP]="EXP"
)
)

How to convert above expression , so that it will plot last year Exp amount ? So that i can get the chart look like above for expense.

 

My PBI file :-

https://www.dropbox.com/s/0vxehy63q1nz4h4/PBT_V2021_400%20GL_TI_3.pbix?dl=0


Paul

 

 

1 ACCEPTED SOLUTION

Hi,

Download my PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@admin11 , Try like

AMOUNT_EXP_LY = CALCULATE([AMOUNT_EXP_], DATEADD('Date'[Date], -1, YEAR))

@amitchandak 

Thank you for sharing. i have try you expression , and when i just plot your expression alone , it return correct result. see below image :-

admin11_0-1621637320722.png

when i combine your expression with 2021 Exp amount expression , it return wrong result :-

admin11_1-1621637548117.png

My PBI sample file :-

https://www.dropbox.com/s/to10ko59wgs9lww/PBT_V2021_400%20GL_TI_4.pbix?dl=0

 

Paul

Hi,

Download my PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

SamePeriodLastYear command working well , thank you very much

Paul

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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