Forum Discussion
How to use MTD function with today's date?
Hi all, i 've written a DAX like this but i wanna improve by making it simplified? like using TotalMTD or DatesMTD but just for today, and we will refresh data every day as it's a daily dashboard, any one have good ideas? Appreciated in advance.
3 Replies
- Ritaf1983
Super User
Hi mathilde16
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - mathilde16New Member
Hi Ritaf1983 ,
Thanks for reminding me, the pbi file is updated here, and i expect a simple DAX (with probably TotalMTD) to replace Sales MTD original DAX.
Google drive link:https://drive.google.com/file/d/18M-fZ7aO2nCA236RBHNOn18dVJaY0hY8/view?usp=drive_link
- AnonymousNot applicable
Hi, mathilde16
Did you learn how to optimize your DAX using the TotalMTD function? You can try the following Measure. If it doesn't work, you can change the settings for sharing data to be accessible without logging into your Google account, right now I can't view the data you're sharing.
Measures:
Measure = VAR _endDate = TODAY() RETURN TOTALMTD(SUM('Table'[Value]), 'Table'[Date], _endDate)Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum