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

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)

@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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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