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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Powers
Helper I
Helper I

How to calculate sum of amount from Jan 2024 to Current Month

Hi Power BI Experts,

Scenario: I have date column, amount column and user want to see the sum of data of 2024 (Jan 2024 to currentmonth) when I  select the June 2024 then the data should sum the between Jan 2024 to June 2024, similarly, If I select May 2024 then the data should sum up between Jan 2024 to May 2024. Similarly, If I select July 2023 then the data should sum up between Jan 2023 to Dec 2023. 
Can anyone help on this issue?

 

Best Regards,
Power BI

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Powers , First create a date table

 

DateTable =
ADDCOLUMNS (
CALENDAR (DATE(2023, 1, 1), DATE(2024, 12, 31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMM YYYY"),
"MonthNumber", MONTH([Date])
)

 

Make sure your Sales table is related to the DateTable on the Date column.

 

DAX
Amount =
VAR __SelectedMonth = MAX(DateTable[Date])
VAR __StartDate = DATE(YEAR(__SelectedMonth), 1, 1)
VAR __EndDate = EOMONTH(__SelectedMonth, 0)
RETURN
CALCULATE(
SUM(Sales[Amount]),
FILTER(
ALL(DateTable),
DateTable[Date] >= __StartDate && DateTable[Date] <= __EndDate
)
)

 

Add a slicer to your report using the Month column from the DateTable




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Powers , First create a date table

 

DateTable =
ADDCOLUMNS (
CALENDAR (DATE(2023, 1, 1), DATE(2024, 12, 31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMM YYYY"),
"MonthNumber", MONTH([Date])
)

 

Make sure your Sales table is related to the DateTable on the Date column.

 

DAX
Amount =
VAR __SelectedMonth = MAX(DateTable[Date])
VAR __StartDate = DATE(YEAR(__SelectedMonth), 1, 1)
VAR __EndDate = EOMONTH(__SelectedMonth, 0)
RETURN
CALCULATE(
SUM(Sales[Amount]),
FILTER(
ALL(DateTable),
DateTable[Date] >= __StartDate && DateTable[Date] <= __EndDate
)
)

 

Add a slicer to your report using the Month column from the DateTable




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors