Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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/17 | 1 |
01/05/17 | 1 |
01/04/17 | 2 |
01/03/17 | 3 |
01/02/17 | 3 |
01/01/17 | 1 |
01/31/16 | 1 |
01/30/16 | 5 |
01/29/16 | 4 |
01/28/16 | 2 |
01/27/16 | 4 |
01/26/16 | 7 |
01/25/16 | 6 |
01/24/16 | 5 |
01/23/16 | 6 |
01/22/16 | 9 |
01/21/16 | 8 |
01/20/16 | 7 |
01/19/16 | 6 |
01/18/16 | 4 |
01/17/16 | 1 |
01/16/16 | 2 |
01/15/16 | 5 |
01/14/16 | 4 |
01/13/16 | 2 |
01/12/16 | 3 |
01/11/16 | 1 |
01/10/16 | 5 |
01/09/16 | 4 |
01/08/16 | 3 |
01/07/16 | 1 |
01/06/16 | 1 |
01/05/16 | 1 |
01/04/16 | 1 |
01/03/16 | 2 |
01/02/16 | 3 |
01/01/16 | 1 |
Solved! Go to Solution.
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.
Please feel free to ask if you have other issue.
Best Regards,
Angelia
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.
Please feel free to ask if you have other issue.
Best Regards,
Angelia
In the solutions offered above the DAX formula "SAMEPERIODLASTYEAR" is used to generated Prior Year YTD. However, for my case i cannot use SAMEPERIODLASTYEAR because it doesn't allow for "true/false" comparisons as the conditions is a column. wondering if anyone has an idea on how to circunvent this issue.
Hi @lerodriguez - as this thread is almost 3 years old it is better to start a new thread than reply to this one. That way you can give all of the details you need and we can focus on solving your particular issue.
Try
CALCULATE( TOTALYTD( AVERAGE...), SAMEPERIODLASTYEAR( [DateCol] ) )
Hope this helps
David
or:
TOTALYTD( AVERAGE( Table[Column] ), SAMEPERIODLASTYEAR ( Calendar[Date] ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |