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 LYTD expression for P&L So that it auto return LYTD amount ?

Hi All

 

Below expression working fine , now it will display Last YTD full amount :-

 

_LYTD EXP = CALCULATE(CALCULATE(GL[AMOUNT],DATESYTD(dateadd('Date'[Date],-1,year),"12/31")), GL[1_EXP] = "EXP")
 
May i know how to to modify , so that i don't need to select year=2021 and month =2 , it will return Last YTD amount.
 
_LYTD EXP_ =
var _max = date(year(today())-1,month(today()),day(today()))
return
TOTALYTD(
GL[AMOUNT]
,dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
, GL[1_EXP] = "EXP")
 
i try above not working. Below is the error msg.
 
admin11_0-1615503059400.png

 

 
Paul Yeo
 
1 ACCEPTED SOLUTION

Hi,

This measure works

_LYTD EXP 1 = CALCULATE([AMOUNT],GL[1_EXP]="EXP",DATESBETWEEN('Date'[Date],date(year(today())-1,1,1),eomonth(today(),-13)+1))

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=calculate([Amount],datesbetween('Date'[Date],edate(eomonth(today(),-1),-12),eomonth(today(),-1))

I have assumed that amount is a measure.  This measure will calculate the amount for the 12 months ended the last day of the current month less 1.  So if today is March 12, 2021, the last day of the current month less 1 will be February 28, 2021.  The time period will be March 1, 2020 to February 28, 2021.

Hope this helps.


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

@Ashish_Mathur 

Thank you for sharing .

Actually i have below expression working fine :-

_LYTD EXP = CALCULATE(CALCULATE(GL[AMOUNT],DATESYTD(dateadd('Date'[Date],-1,year),"12/31")), GL[1_EXP] = "EXP")
For above expression i need to click on year=2021 , month = Feb . 
 
Can you hep me modify the above expression , so that with out select year= 2021 , month = Feb , it will still return the same number.
 
Enclosed my PBI file :-
 
Paul  
 

Hi,

This measure works

_LYTD EXP 1 = CALCULATE([AMOUNT],GL[1_EXP]="EXP",DATESBETWEEN('Date'[Date],date(year(today())-1,1,1),eomonth(today(),-13)+1))

Hope this helps.

Untitled.png


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

@Ashish_Mathur 

Appreciate very much.

You are welcome.


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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.