cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Show average for same period last year

Hi all,

I wanted to see if there was a way to show what the average of last year was on a line graph.  So say the average for this graph below is the average of week 34 of 2018, is there any way i can show the average of week 34 for 2017 either through a line or a tooltip

1 ACCEPTED SOLUTION
Community Support

Hi @thenovice,

I made one sample for your reference.

1. Create a date table and create relationship between fact table and it.

Table = CALENDARAUTO()

2. Create the measures as below.

sumsa = CALCULATE(SUM(Table1[sales]),SAMEPERIODLASTYEAR(Table1[date]))
avesamp = SUMX(ALLSELECTED(Table1),[sumsa])/CALCULATE(COUNTROWS(Table1),FILTER(ALLSELECTED(Table1),SAMEPERIODLASTYEAR(Table1[date])))

For more details, please check the pbix as attached.

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
5 REPLIES 5
Community Support

Hi @thenovice,

I made one sample for your reference.

1. Create a date table and create relationship between fact table and it.

Table = CALENDARAUTO()

2. Create the measures as below.

sumsa = CALCULATE(SUM(Table1[sales]),SAMEPERIODLASTYEAR(Table1[date]))
avesamp = SUMX(ALLSELECTED(Table1),[sumsa])/CALCULATE(COUNTROWS(Table1),FILTER(ALLSELECTED(Table1),SAMEPERIODLASTYEAR(Table1[date])))

For more details, please check the pbix as attached.

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Frequent Visitor

Thank you so much! Will this work if i add it in as a tool tip, because i have a line graph already.

Community Support

Hi @thenovice,

Please refer to the picture.

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Super User

Should be able to use a measure in your tooltip. See if my Time Intelligence the Hard Way provides a way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Frequent Visitor

Currently trying this, thank you very much by the way. What would i put at the end of the measure where it say "[Value]"

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors