Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Everyone,
My Financial Year (FY) runs from December to November.
Now I am trying to create a YTD measure for sales as follows:
Sales Date Max = CALCULATE(MAX('Sales'[InvoiceDate]), All ('Sales'))
@Anonymous , With help from date table and time intelligence
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"11/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"11/30"))
Power BI December to November Financial Year Calendar: https://community.powerbi.com/t5/Quick-Measures-Gallery/Power-BI-December-to-November-Financial-Year-Calendar/m-p/1574446#M657
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi @amitchandak
Thanks for looking into it and sharing the solution.
When I tried it, the first part worked, i.e. 'YTD Sales' measure worked but I am facing an issue with 'Last YTD Sales' measure. I am using my 'Invoice Date' column for dates that has duplicate date values and I think for that is creating an issue.
Error msg -> "[Last YTD Sales]: Function 'DATEADD' expects a contiguous selection when the date column is not unique, has gaps or it contains time portion."
Is there a workaround where I can still use the 'Invoice Date' field to get the desired output?
Thanks for your help.
Animesh
@Anonymous , use date table, marked as date, else you will get some error or other
I discussed these issues in details here - https://www.youtube.com/watch?v=OBf0rjpp5Hw
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |