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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Pawan
Frequent Visitor

MTD and LY MTD help

Hi,

 

I have the requirement to calculate MTD, LY MTD based on below logics

MTD should show default month selection i.e., till today 23/1/2023 data need to display as default MTD value

LY MTD should show data upto 23/1/2022 as default LY MTD value

Note. User can select full year/quarter/month from below filter pane. based on selection MTD and LY MTD values need to change dynamically.

Pawan_0-1674485607941.png

 

I have calculated MTD, LY MTDby using below expression with default month filter. Its working only for 2023 full year and all years jan selection. When i have slected 2022 feb then getting blank data in LY MTD value.

 

Please help me to write these logics.

MTD = CALCULATE( Sum(Sales[NetAmountGBP]), Sales[IsInternalOrder]=False,'Date'[CurrentDayOffset]<=0)

LY MTD = CALCULATE (
[MTD],
FILTER (
SAMEPERIODLASTYEAR ( 'Date'[Date] ),
FORMAT ( [Date], "MMDD" ) <= FORMAT ( TODAY (), "MMDD" )
)
)

@Anonymous 

Thanks in advance
 
0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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