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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors