Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ahassan
Frequent Visitor

Need help creating 5 year history graph

How would you recreate this graph below?  Particularly the 5 year grey band that represents the 5 year range?  Also sorting the x axis by month day has been an issue I've been running into, any ideas?

 

ahassan_0-1703688644180.png

 

2 ACCEPTED SOLUTIONS
v-xuxinyi-msft
Community Support
Community Support

Hi @ahassan 

 

Based on the information you provided, I ran the following tests:

 

My sample:

Table = CALENDAR(DATE(2017,1,1), DATE(2023,12,31))
value = (RAND() + 1) * 100

vxuxinyimsft_0-1703756808800.png

 

1. create several measures as shown below.

5 Year Range = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Date].[Month]))
5 Year Average = DIVIDE([5 Year Range],5)
2022 = CALCULATE(SUM('Table'[value]), FILTER('Table', YEAR('Table'[Date]) = 2022))
2023 = CALCULATE(SUM('Table'[value]), FILTER('Table', YEAR('Table'[Date]) = 2023))

 

2. create the visual as shown below

vxuxinyimsft_1-1703756946477.png

 

You can modify the effect you want with the options shown in the screenshot.

vxuxinyimsft_2-1703756991565.png

 

This is my setting.

vxuxinyimsft_3-1703757059542.png

 

vxuxinyimsft_4-1703757109589.png

Is this the result you expect?

If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @ahassan

 

You can modify the following formula:

 

5 Year Range = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table', 'Table'[Date]))

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

 

Best Regards,
Community Support Team _Yuliax

View solution in original post

3 REPLIES 3
v-xuxinyi-msft
Community Support
Community Support

Hi @ahassan 

 

Based on the information you provided, I ran the following tests:

 

My sample:

Table = CALENDAR(DATE(2017,1,1), DATE(2023,12,31))
value = (RAND() + 1) * 100

vxuxinyimsft_0-1703756808800.png

 

1. create several measures as shown below.

5 Year Range = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table','Table'[Date].[Month]))
5 Year Average = DIVIDE([5 Year Range],5)
2022 = CALCULATE(SUM('Table'[value]), FILTER('Table', YEAR('Table'[Date]) = 2022))
2023 = CALCULATE(SUM('Table'[value]), FILTER('Table', YEAR('Table'[Date]) = 2023))

 

2. create the visual as shown below

vxuxinyimsft_1-1703756946477.png

 

You can modify the effect you want with the options shown in the screenshot.

vxuxinyimsft_2-1703756991565.png

 

This is my setting.

vxuxinyimsft_3-1703757059542.png

 

vxuxinyimsft_4-1703757109589.png

Is this the result you expect?

If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

Best Regards,
Community Support Team _Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Looks like your answer calculates the sum for each month, but I need it for month day.  For the example, instead of the sum of March, I need the sum of March 3rd

Hi @ahassan

 

You can modify the following formula:

 

5 Year Range = CALCULATE(SUM('Table'[value]),ALLEXCEPT('Table', 'Table'[Date]))

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

 

Best Regards,
Community Support Team _Yuliax

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.