Forum Discussion
thenovice
7 years agoFrequent 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 ...
- 7 years ago
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
v-frfei-msft
Community Support
7 years agoHi 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
thenovice
7 years agoFrequent Visitor
Thank you so much! Will this work if i add it in as a tool tip, because i have a line graph already.
- v-frfei-msft7 years ago
Community Support