Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
Not sure if this has been asked before, but I am trying to plot the current running YTD against the full prior running YTD. This would essentially involve creating a table that looks like this that I can convert into a plot:
I have created an unconnected Date table that has contains all the months of 2024 to use as the x-axis since the connected Date table truncates at the last available date in the Fact table. I have created the following measure:
CurrYTD = CALCULATE(SUM('Fact'[Val]), ALL('DimProd'), 'Prod'[ID] = 1, DATESYTD(
And it seems to work, but I am not sure what the DAX would be for the Prior YTD. All of my attempts end up with a table that truncates in April for both the Current and Prior YTD. Like I said, I want the entire Prior YTD.
Also, I want the measure to be dynamic when the model updates with data in January of the next year.
Any help is appreciated!
Solved! Go to Solution.
I'm going to assume your data looks something like the following:
Sales Table
Date Table (note the year column is not necessary)
And i've created a relationship between the two.
and then i use the following calculations:
Sales YTD = CALCULATE(SUM('Table'[Sales]), DATESYTD('Calendar'[Date]))
Prev year sales = CALCULATE([Sales YTD], SAMEPERIODLASTYEAR('Calendar'[Date]))
Hi @WishAskedSooner ,
Thanks @vicky_ for his reply.
Have you tried the syntax he provided?
Did it help you solve the problem? If yes, please accept his answer as the solution, which will be of great help to users who encounter similar problems as yours.
If you have any further questions, please feel free to contact me.
Best Regards,
Yang
Community Support Team
I'm going to assume your data looks something like the following:
Sales Table
Date Table (note the year column is not necessary)
And i've created a relationship between the two.
and then i use the following calculations:
Sales YTD = CALCULATE(SUM('Table'[Sales]), DATESYTD('Calendar'[Date]))
Prev year sales = CALCULATE([Sales YTD], SAMEPERIODLASTYEAR('Calendar'[Date]))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |