Forum Discussion
Current Year vs avg previous years
Dear community,
I'm new to PowerBI and need help.
I'm trying to display a bar graph of precipication of current year and would like a line of average of previous years precipication
My chart currently looks like this
And would like a chart with Average of previous years grouped by month like this
My data looks like this :
| monthly_date | precipitation_sum |
| 1/1/2008 | 50 |
| 2/1/2008 | 40 |
| 3/1/2008 | 34 |
| 4/1/2008 | 234 |
| 5/1/2008 | 12 |
| 6/1/2008 | 12 |
| 7/1/2008 | 423 |
I was able to do the same, I grouped by month and created a column sum, and another column to count the no of months, I then dicided the sum by count to get average precipitation per month.
here is my visual
4 Replies
- Ashish_Mathur
Super User
Hi,
Share data of 2 years and show the expected result in a simple Table format. Once we create the table, we will easily be able to plot it on a visual.
- kavya_gpFrequent Visitor
for the expected result, I want a bar graph with a line of the average precipitation for the previous years grouped by month,
- kavya_gpFrequent Visitor
Hi Ashish please find the entire dataset
monthly_date precipitation_sum 1/1/2008 101.1999957 2/1/2008 114.5999997 3/1/2008 68.600001 4/1/2008 223.6000072 5/1/2008 597.3999966 6/1/2008 577.3999986 7/1/2008 286.5999974 8/1/2008 262.1999979 9/1/2008 235.8000024 10/1/2008 40.4000006 11/1/2008 129.6000043 12/1/2008 240.5999998 1/1/2009 121.1999996 2/1/2009 68.60000168 3/1/2009 85.00000026 4/1/2009 188.9999918 5/1/2009 193.2000019 6/1/2009 367.2000079 7/1/2009 403.400006 8/1/2009 281.0000014 9/1/2009 115.2000024 10/1/2009 331.7999934 11/1/2009 54.2000015 12/1/2009 169.1999949 1/1/2010 92.6000016 2/1/2010 48.8000006 3/1/2010 52.800001 4/1/2010 565.8000064 5/1/2010 652.99999 6/1/2010 759.7999892 7/1/2010 306.1999972 8/1/2010 341.5999994 9/1/2010 236.6000023 10/1/2010 90.3999956 11/1/2010 294.2000051 12/1/2010 58.00000076 1/1/2011 248.8000021 2/1/2011 114.1999989 3/1/2011 145.4000017 4/1/2011 339.3999951 5/1/2011 540.2000021 6/1/2011 500.3999999 7/1/2011 105.3999998 8/1/2011 104.0000027 9/1/2011 88.4000032 10/1/2011 284.6000028 11/1/2011 95.0000007 12/1/2011 74.20000008 1/1/2012 60.00000126 2/1/2012 93.2000018 3/1/2012 174.8000012 4/1/2012 321.1999978 5/1/2012 490.59999 6/1/2012 756.0000099 7/1/2012 177.8000062 8/1/2012 175.2000069 9/1/2012 30.7999996 10/1/2012 296.8000065 11/1/2012 163.1999976 12/1/2012 55.99999918 1/1/2013 97.60000378 2/1/2013 60.2000024 3/1/2013 113.7999993 4/1/2013 336.1999928 5/1/2013 415.3999934 6/1/2013 599.6000042 7/1/2013 232.7999987 8/1/2013 218.6000026 9/1/2013 442.6000098 10/1/2013 132.5999968 11/1/2013 106.8000027 12/1/2013 218.1999881 1/1/2014 125.7999986 2/1/2014 31.6000013 3/1/2014 191.6000044 4/1/2014 235.2000023 5/1/2014 367.8000011 6/1/2014 830.6000283 7/1/2014 116.0000004 8/1/2014 505.200003 9/1/2014 383.8000081 10/1/2014 115.9999991 11/1/2014 283.0000104 12/1/2014 113.8000011 1/1/2015 131.3999998 2/1/2015 62.6000014 3/1/2015 195.0000001 4/1/2015 105.9999995 5/1/2015 192.3999986 6/1/2015 157.6000016 7/1/2015 371.600011 8/1/2015 119.0000004 9/1/2015 312.1999992 10/1/2015 144.7999992 11/1/2015 174.0000065 12/1/2015 104.4000001 1/1/2016 97.1999996 2/1/2016 87.40000078 3/1/2016 134.8000055 4/1/2016 257.6000067 5/1/2016 600.7999818 6/1/2016 262.8000016 7/1/2016 430.7999971 8/1/2016 412.0000065 9/1/2016 204.8000033 10/1/2016 329.2000049 11/1/2016 29.4000004 12/1/2016 109.4000034 1/1/2017 77.59999568 2/1/2017 155.4000014 3/1/2017 123.9999932 4/1/2017 310.6000013 5/1/2017 323.0000094 6/1/2017 324.0000087 7/1/2017 89.9999958 8/1/2017 87.6000004 9/1/2017 67.00000008 10/1/2017 372.6000072 11/1/2017 160.000007 12/1/2017 194.3999957 1/1/2018 69.2000016 2/1/2018 246.2000034 3/1/2018 224.0000011 4/1/2018 182.8000008 5/1/2018 155.999997 6/1/2018 449.2000016 7/1/2018 125.1999983 8/1/2018 123.0000072 9/1/2018 194.8000004 10/1/2018 152.600002 11/1/2018 175.1999997 12/1/2018 90.3999967 1/1/2019 81.7999992 2/1/2019 161.600004 3/1/2019 68.7999978 4/1/2019 176.5999945 5/1/2019 289.0000011 6/1/2019 410.2000004 7/1/2019 217.600002 8/1/2019 220.999998 9/1/2019 463.8000167 10/1/2019 140.2000008 11/1/2019 341.7999937 12/1/2019 90.6000004 1/1/2020 110.0000016 2/1/2020 157.1999942 3/1/2020 153.6000049 4/1/2020 154.999997 5/1/2020 518.9999899 6/1/2020 640.2000088 7/1/2020 196.1999991 8/1/2020 41.80000056 9/1/2020 228.2000122 10/1/2020 222.5999986 11/1/2020 269.7999971 12/1/2020 98.6000029 1/1/2021 31.9999992 2/1/2021 113.2000022 3/1/2021 96.0000004 4/1/2021 167.5999982 5/1/2021 394.4000022 6/1/2021 207.4000077 7/1/2021 49.59999848 8/1/2021 322.799998 9/1/2021 80.6000003 10/1/2021 211.1999993 11/1/2021 106.0000001 12/1/2021 136.5999997 1/1/2022 92.99999998 2/1/2022 128.1999967 3/1/2022 131.2000038 4/1/2022 126.5999993 5/1/2022 192.8000001 6/1/2022 864.9999958 7/1/2022 265.5999976 8/1/2022 125.0000066 9/1/2022 87.2000037 10/1/2022 258.9999965 11/1/2022 245.7999958 12/1/2022 233.4000041 1/1/2023 78.39999918 2/1/2023 178.799999 3/1/2023 134.1999989 4/1/2023 120.8000046 5/1/2023 283.4000011 6/1/2023 228.5999939 7/1/2023 157.0000048 8/1/2023 212.200011 9/1/2023 85.60000118 10/1/2023 272.9999964 11/1/2023 62.8000011 12/1/2023 76.39999878 1/1/2024 413.7999982 2/1/2024 640.7000128 3/1/2024 276.300007 - kavya_gpFrequent Visitor
I was able to do the same, I grouped by month and created a column sum, and another column to count the no of months, I then dicided the sum by count to get average precipitation per month.
here is my visual