The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to create custom Year To date.
I am currently using the query Calculate(Sum(value),DATEADD(Date,-1,Year)) and this calculation is -365 days.
I want to give the start date as (Start of the date of the previous year )and end date as ((current day)-365) using my calendar lookup table for the above specified scenario.
Please help me with the query.
Solved! Go to Solution.
Calculate(Sum(value),DATESBETWEEN(Dates[Date],Date(Year(Today())-1,1,1),Today()-365))
Calculate(Sum(value),DATESBETWEEN(Dates[Date],Date(Year(Today())-1,1,1),Today()-365))
Thank you very much for your response, This is working great.
Hi, @HBALAMURUGAN ;
Can you give an example? I don't quite understand, could provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
Solved: How to upload PBI in Community - Microsoft Power BI Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @HBALAMURUGAN ;
Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The answer is helping me to specify the start date of the year to date.However, I need to also specvify the end date for the YTD. Looking forward to have your support in this regard.
Hi, @HBALAMURUGAN ;
You could create a measure as follow:
TotalYTD1 = TOTALYTD(SUM(Invoices[Total]), Dates[Date], ALL(Dates), "06/30")
if you want to change other date, could modify "6/30" to another date.
or try to use EDATE() funtion.
EDATE function (DAX) - DAX | Microsoft Learn
measure =
CALCULATE ( SUM ( 'table'[value] ), EDATE ( 'table'[date], -12 ) )
if not right, can you share a simple data and the result what you want to output?
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.