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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
admin11
Memorable Member
Memorable Member

When i try to convert YTD expression to LYTD i get null display

Hi All

 

I have below YTD expression working fine :-

Expense_YTD _ =
var _max = date(year(today())-0,month(today()),day(today()))
return
TOTALYTD(GL[AMOUNT],'Date'[Date], GL[1_EXP] = "EXP",'Date'[Date]<=_max)
 
From the above expression , i try to modify to LYTD , i get null return :-
 
admin11_0-1616156956470.png

My PBI file :-

 

 

Paul

2 REPLIES 2
amitchandak
Super User
Super User

@admin11 , Please check the file attached after signature

Expense_LYTD_ = 

var _max = date(year(today())-1,month(today()),day(today()))

return

CALCULATE(TOTALYTD(GL[AMOUNT],'Date'[Date], GL[1_EXP] = "EXP"),'Date'[Date]<=_max)
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Your expression working fine.

But when i click on month jan till march , i cannot get the following :-

Jan return -376 m

Feb return -488 m

Mar return -501 m

it keep display -501m

Below link is my PBI file :-

https://www.dropbox.com/s/38u4j3fpumy217k/PBT_V2021_382%20TI_SI_GL%20SAMPLE%20how%20to%20get%20jan%2...

 

Paul

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.