Forum Discussion
Average Per Cover Depends for Dynamic Time Period
A strike-through straight line can be easy in a certain dimension, but so far I have no idea on creating a measure that would vary when drilling down to Year,Quarter,month or day(I doubt it possible?), that's why I used a multi-row card instead.
For example, an 12 months‘ average straight line passes through months.
MonthAVG = CALCULATE(SUM('Table'[QTY]),ALL(Table))/
CALCULATE (
DISTINCTCOUNT( 'Date'[Monthnumber]),
'Table'
)
If you have any question, feel free to let me know.
A follow up. I've found another dynamic way that can cover Year,Quarter,Month level, however it won't work in day level.
The test pbix is attached for your reference. Please follow below steps.
- The dataset is as
- Add the column [MONTH] in 'Table'.
- Add the table 'SummarizedTable'.
- Add the column [MonthlyAVG] in 'SummarizedTable'
- Create a Many to 1 relationship between 'Table' and 'SummarizedTable'.
- Show in the visual
More details about the steps are in the attached pbix. If you have any question, feel free to let me know.
- Rahul_Bhatt10 years ago
Advocate I
Eric_Zhang i am still facing the issue Please find the data model and test it on the secnario where for some years data starts 8 and like that .please download the test data.PIBX from below link.
- Eric_Zhang10 years ago
Microsoft Employee
The peak&valley and caused by the absent months. I've created a calender table to fill up the missing months, please check the attachment. By the way, I was testing on the latest May's release, please upgrade your Power Bi desktop if you can't open the pbix.
Please accept it as solution if the the attaced pbix works, thanks. :) If you have any question, feel free to let me know.- Rahul_Bhatt10 years ago
Advocate I
Eric_Zhang Thanks Eric,Good job .