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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
admin11
Memorable Member
Memorable Member

How to modify the YTD expression less 1 month ?

Hi All

 
_YTD_EXP = CALCULATE(CALCULATE(GL[AMOUNT_EXP_]*-1,DATESYTD('DATE'[Date],"12/31")))
Above expression work fine for last 3 year.
 
Due to account raw data alway arrive late , may i know how to modify the above expression to compute YTD less 1 month ?
 
Paul
 
 
 
 
6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure 1 = calculate([AMOUNT_EXP_],datesbetween('Date'[Date],date(year(today()),1,1),eomonth(today(),-1)))

I have assumed that AMOUNT_EXP_ is already a measure you have written.  Measure 1 will calculate from Jan 1, 2022 to last date of the previous month i.e. May 31, 2022.

Hope this helps.


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

Hi @Ashish_Mathur 

May be it is better to modify LYTD expression , to reduce one more month , instead of YTD :-

_LYTD_EXP =
VAR _max =
DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 )
RETURN
TOTALYTD (
( 'GL'[AMOUNT_EXP] ),
DATEADD ( 'DATE'[Date], -1, YEAR ),
'DATE'[Date] <= _max
)

@Ashish_Mathur 

i Get same result.

admin11_0-1654562516118.png

 

 

Above link is my PBI file

 

Paul

I do not understand your required result.  Please show the expected result clearly with a proper explanation.


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

@Ashish_Mathur 

Thank you for your help alway. appreciate very much. right now i am unable to show you . will post again when the time is right.

Anonymous
Not applicable

Hi @admin11 ,

Whether your problem has been resolved? If no, could you please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better  if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

In addition, please review the following thread which has the similar problem as yours, hope it can help you resolve the problem.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.