cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

YTD calculation with SamePeriodLastYear brings back same values

Hello everyone, 
I'm trying to simulate an exercise from Microsoft PowerBi course in EDX.org, about using meassures and more specifically YTD and SamePeriodLast Year command. 

 

The powerbi project file provided by the course is here : Github Download Link 

Using these data, by  applying DAX commands for YTD Revenue  and LY YTD as below, the numbers I get back are the same for both years which makes the calculation for YTD Variance to be zero.

YTD Revenue = TOTALYTD(SUM(Sales[REevenue]),'Date'[Date])

YTD LY = CALCULATE([YTD Revenue],SAMEPERIODLASTYEAR('Date'[Date]))

 

YTD Var = [YTD Revenue] - [LY YTD]

Annotation 2020-04-21 154803.png

 

I would appriciate if you can help me with choosing the right Date table and fixing the LY YTD

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: YTD calculation with SamePeriodLastYear brings back same values

@sinadvd , looking at screenshot , I doubt either the join with date table is disabled or not there. Please check the join.

Make sure the date table is marked as the date .

The formula seems correct for LY you can also try

YTD LY = TOTALYTD(SUM(Sales[Reevenue]),dateadd('Date'[Date],-1,year))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: YTD calculation with SamePeriodLastYear brings back same values

@sinadvd , looking at screenshot , I doubt either the join with date table is disabled or not there. Please check the join.

Make sure the date table is marked as the date .

The formula seems correct for LY you can also try

YTD LY = TOTALYTD(SUM(Sales[Reevenue]),dateadd('Date'[Date],-1,year))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
New Member

Re: YTD calculation with SamePeriodLastYear brings back same values

Thank you so much! the lack of relational connection was the reason!

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors