cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jagdishpatil Frequent Visitor
Frequent Visitor

YTD and YTD prior

Hello,

 

I am trying to pull in an average YTD and YTD prior year up to Jan 6th in a bar graph. I am able to pull in the YTD using the =TOTALYTD (AVERAGE(.....)) formula, but can anyone please help to figure out how to pull the average YTD prior year for the same period in Desktop Power BI? I am trying to pull both the YTD and YTD prior year in a same bar graph.

 

01/06/171
01/05/171
01/04/172
01/03/173
01/02/173
01/01/171
01/31/161
01/30/165
01/29/164
01/28/162
01/27/164
01/26/167
01/25/166
01/24/165
01/23/166
01/22/169
01/21/168
01/20/167
01/19/166
01/18/164
01/17/161
01/16/162
01/15/165
01/14/164
01/13/162
01/12/163
01/11/161
01/10/165
01/09/164
01/08/163
01/07/161
01/06/161
01/05/161
01/04/161
01/03/162
01/02/163
01/01/161
1 ACCEPTED SOLUTION

Accepted Solutions
v-huizhn-msft Super Contributor
Super Contributor

Re: YTD and YTD prior

Hi @jagdishpatil,

I try to reproduce your scenario and get expected result.

First, create measure to calculate YTD and prvious YTD value.

average = TOTALYTD(AVERAGE(Table2[Value]),Table2[Date])

Prior = CALCULATE(Table2[average],SAMEPERIODLASTYEAR(Table2[Date]))


Then create a stacked column chart and add the two measures above as value levels, please see the following screenshot.

2.PNG

Please feel free to ask if you have other issue.

Best Regards,
Angelia

View solution in original post

4 REPLIES 4
dedelman_clng New Contributor
New Contributor

Re: YTD and YTD prior

Try

 

CALCULATE( TOTALYTD( AVERAGE...), SAMEPERIODLASTYEAR( [DateCol] ) )

 

Hope this helps

David

mattbrice Senior Member
Senior Member

Re: YTD and YTD prior

or:

 

TOTALYTD( AVERAGE( Table[Column] ), SAMEPERIODLASTYEAR ( Calendar[Date] ) )
v-huizhn-msft Super Contributor
Super Contributor

Re: YTD and YTD prior

Hi @jagdishpatil,

I try to reproduce your scenario and get expected result.

First, create measure to calculate YTD and prvious YTD value.

average = TOTALYTD(AVERAGE(Table2[Value]),Table2[Date])

Prior = CALCULATE(Table2[average],SAMEPERIODLASTYEAR(Table2[Date]))


Then create a stacked column chart and add the two measures above as value levels, please see the following screenshot.

2.PNG

Please feel free to ask if you have other issue.

Best Regards,
Angelia

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 60 members 1,171 guests
Please welcome our newest community members: