Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear All,
I have a logic where I have to show data for MTD period.
Sum (Sales)
where Date should be between 1st of the current system/selected month till max date of the selected date/Filter.
Eg:- If current_Date is 07-Feb-2024
Chart should show sales from 01-Feb-2024 till 07-Feb-2024 automatically.
If user select month filter as Jan-2024, then
Chart should show sales from 01-Jan-2024 till 31-Jan-2024.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
Date = CALENDARAUTO()
(2) We can create measures.
Measure 3 =
var _date=SELECTEDVALUE('Date'[Date])
var _date_start=DATE(YEAR(_date),MONTH(_date),1)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date_start && 'Date'[Date]<=_date))Measure 4 =
var _date=DATE(SELECTEDVALUE('Date'[Date].[Year]),SELECTEDVALUE('Date'[Date].[MonthNo]),1)
var _date_end=EOMONTH(_date,0)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date && 'Date'[Date]<=_date_end))
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
Date = CALENDARAUTO()
(2) We can create measures.
Measure 3 =
var _date=SELECTEDVALUE('Date'[Date])
var _date_start=DATE(YEAR(_date),MONTH(_date),1)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date_start && 'Date'[Date]<=_date))Measure 4 =
var _date=DATE(SELECTEDVALUE('Date'[Date].[Year]),SELECTEDVALUE('Date'[Date].[MonthNo]),1)
var _date_end=EOMONTH(_date,0)
RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date && 'Date'[Date]<=_date_end))
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello! You can use the TOTALMTD DAX Function to achieve this. You can enter it manual or use quick measures. The below measure assumes you have a measure for Sales and a date table.
Proud to be a Super User! | |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!