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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anmolgan
Post Prodigy
Post Prodigy

How to calculate LYTD and CYTD without having a date filter in report page?

I want to calculate last year ytd and current year ytd, without using a calender date table in my report page view, now my FY starts every year from April and ends on March, so my LYTD is April 2019 - Feb 2020. and my CYTD is April 2020 - Feb 2021, am not taking current month till date in my ytd scenerios, now I have build below for the above logic, this is as per CYTD:

 

CY Year = VAR EndDate =
DATE(YEAR( TODAY()),MONTH(TODAY())-1,31)
VAR StartDate =
DATE(YEAR( TODAY())-1,4,1)
var _b=
CALCULATE (
SUM('FWS Report for National'[Billing Qty]),
CALCULATETABLE (
'FWS Report for National',
FILTER (
'FWS Report for National',
'FWS Report for National'[Calendar Day.Calendar Day Level 01.Key]>= StartDate
&& 'FWS Report for National'[Calendar Day.Calendar Day Level 01.Key]<= EndDate
)
)
)
Return
_b/1000
 
but it gives me incorrect result because am specifying DATE(YEAR( TODAY()),MONTH(TODAY())-1,31) and in case of februrary this gives me March 3 2021 till date calculation which is incorrect, how can I build more robust formula which will only take current month -1 and does not go about specifiying dates here???

 

 

1 ACCEPTED SOLUTION
Anmolgan
Post Prodigy
Post Prodigy

I think I figured this out using EOMONTH DAX thanks for the help

View solution in original post

1 REPLY 1
Anmolgan
Post Prodigy
Post Prodigy

I think I figured this out using EOMONTH DAX thanks for the help

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors