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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
cv2qm
Helper I
Helper I

Dax for total sum up to selected month for each fiscal year

Hello Community,

 

I am trying to get the total sales up to selected month for each fiscal year (6/30).
Calender date table is connected with date column in all tables. 

I tried below DAX, but seems it is not working as expected. It is not adding up July and August month when i select September.
Also i am looking for Total sales from selected month till end of each fiscal year.

Could anyone help me with both DAX queries. 
1. Pre sales = Total sales upto selected month till end of each fiscal year (6/30).

2. Post sales = Total sales from selected month till end of each fiscal year(6/30).

 

 

 

Pre sales = 
VAR maxmonth=MAXX(Allselected('Calender'), 'Calender'[FiscalYear-Month] ) 
VAR maxyear=MAXX(Allselected('Calender'), 'Calender'[FiscalYear] ) 
var Sum_value = GA[Cost]+GL[Sum]+GL&GA[Other Amount] 
return CALCULATE(Sum_value,FILTER(ALL('Calender'),Calender[FiscalYear]=maxyear && 'Calender'[FiscalYear-Month]<=maxmonth))

 

 

Thanks in advance

1 REPLY 1
colacan
Resolver II
Resolver II

@cv2qm  Hi,

I recomment to make calendar table with  CALENDARAUTO(6) which calcualte all timeseries functions based on fiscal year of Jul~Jun.  then you amy use TOTALYTD([sales], <Date>, [filter1, filter2...])

 

Thanks,

 

Please mark this as solution if this helped you.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.