Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I followed this post to create a chart that has a rolling average:
https://community.powerbi.com/t5/Desktop/12-Month-Rolling-average/m-p/323299#M144109
As far as I can tell, the solution works as intended (though I didn't need to change AVERAGEX to SUMX), but I need to be able to expand my date hierarchy to either year+quarter or year+month. Every time I expand the hierarchy the table breaks, though.
Before expanding:
After Expanding:
Is there a way to do this or am I asking the impossible?
Solved! Go to Solution.
Hey @Anonymous ,
I'm not 100% shure if I understand correctly what you mean by "breaks" the visual.
My assumption is this: Due to the "outlier" with an established date way back in the past, there are a lot of quarter / month with an rolling average, if you drill down from year to ...
And the goal: Avoid the "unnecessary" level.
To achieve this I created this measure:
Rolling Average =
var _NullValue = CALCULATE(SUM('Table'[Setup Time]))
return
IF(NOT(ISBLANK(_NullValue))
, CALCULATE(
AVERAGEX(
'Table'
, CALCULATE(AVERAGE('Table'[Setup Time]))
)
, FILTER(
ALL('Calendar')
, 'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
, BLANK()
)
The essential part is not the calculation of the rolling average using CALCULATE(AVERAGEX(... , ...) , ...), the essntial part is the calculation of the "_NullValue", whenever there is no "Setup Time", the rolling average will not be calculated, using IF(NOT(ISBLANK(_NullValue)) , <the calculation of the rolling average> , BLANK()) prevents the calculation of the rolling average even if there is no "Setup time".
Hopefully this is what you are looking for.
Regards,
Tom
Hi , @Anonymous
According to your description, I do not quite understand your question.
Could you please share your PBIX/some sample data and expected result to me if you don't have any Confidential Information?
You can upload your pbix file to OneDrive and share it with me if it is convenient..
Remember that you should remove security and sensitive data within the report.
Best Regards,
Community Support Team _ Eason
I can't share the PBIX since I believe it's mostly confidential but here's a mock-up of what the data looks like as well as the desired output:
Customers
Name | Established Date | Setup Time |
Company A | 11/2/1980 | 30 |
Company B | 7/8/2017 | 50 |
Company C | 3/6/2018 | 42 |
Company D | 5/9/2018 | 67 |
Company E | 8/6/2018 | 43 |
Those are essentially all of the relevant fields in this visual of the report. From this data I want to create a column chart of Established Date month + year on the X-axis vs the average Setup Time of all companies established on or before the given month (rolling average that covers all time beforehand).
I followed the linked tutorial in my first post, and it creates a rolling average just fine, but there are two problems with it.
1. The chart begins including months between an outlying company that was established long before all others and the next earliest established company, which is several decades of useless months
2. As the Established Date field is a date hierarchy, I want to be able to expand downward to display either the quarter + month, or the year + month but when I expand downward the chart breaks as depicted.
Hey @Anonymous ,
I'm not 100% shure if I understand correctly what you mean by "breaks" the visual.
My assumption is this: Due to the "outlier" with an established date way back in the past, there are a lot of quarter / month with an rolling average, if you drill down from year to ...
And the goal: Avoid the "unnecessary" level.
To achieve this I created this measure:
Rolling Average =
var _NullValue = CALCULATE(SUM('Table'[Setup Time]))
return
IF(NOT(ISBLANK(_NullValue))
, CALCULATE(
AVERAGEX(
'Table'
, CALCULATE(AVERAGE('Table'[Setup Time]))
)
, FILTER(
ALL('Calendar')
, 'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
, BLANK()
)
The essential part is not the calculation of the rolling average using CALCULATE(AVERAGEX(... , ...) , ...), the essntial part is the calculation of the "_NullValue", whenever there is no "Setup Time", the rolling average will not be calculated, using IF(NOT(ISBLANK(_NullValue)) , <the calculation of the rolling average> , BLANK()) prevents the calculation of the rolling average even if there is no "Setup time".
Hopefully this is what you are looking for.
Regards,
Tom
User | Count |
---|---|
91 | |
73 | |
68 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
73 | |
60 | |
58 |