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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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