Forum Discussion
Adding Measure extends X-Axis...
- 1 year ago
your data model is the wrong way round.
Dates should be the dimension table and "Table1" the facts table.
Then do what Ashish_Mathur suggested.
Why is the dark line supposed to be straight? It's an average over 30 days.
By the way, you can do that much simpler with Window functions.
30DayAvg = CALCULATE(AVERAGE(Table1[Reading]), WINDOW(-29,REL,0,rel,ALLSELECTED(Dates[Date]))) - 1 year ago
PBI file attached.
calculating a static last 30 day average regardless of any filters selected. I was able to achieve that, although I had to use nested CALCULATE's. The problem now is, whenever I add it to the line chart, it extends the x-axis to include all dates.
You removed all filters on the date. But it sounds like you didn't want to do that?
- bvy1 year agoHelper V
I had to do that to get the average to be correct. Do you see another way?
- lbendlin1 year agoSuper User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- bvy1 year agoHelper V
https://www.icloud.com/iclouddrive/005zx52OtE6uGPWPbm07jWGLA#x_axis_issue
Attached. Understand that it's not always easy to upload files for those of us who work in corproate environments where everything is locked down. I thought it was straightforward enough to understand from a screenshot, but realize that a PBIX is always better when asking for help.
Thanks for looking.