Forum Discussion
30 Day average ignoring date filter
Hello a simple one I hope, I've looked at several posts and can't quite get to the answer.
I have a table which looks like this below.
The 30 day average metric is a rough formula which looks at how many were created, divides it by how many days worth of data there is and multiplies the result by 30.
3 Replies
- amitchandak
Super User
Anonymous , Try like
30_day_average =
DIVIDE([Created], distinctcount(PROdat_Data[SubmitDate]))*30Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.- AnonymousNot applicable
thanks for the help, didn't do what I was looking for but actually set me on the right path...I think
I've got closer by finding the number of day's I'm interested in bypassing the filter with the below.
DIVIDE(COUNTX(filter(all(PROdat_Data),PROdat_Data[Top Tags]="Citrix XenApp - session - disconnect"),PROdat_Data[Top Tags]),datediff(calculate(Min(PROdat_Data[SubmitDate]),ALL(PROdat_Data)),calculate(Max(PROdat_Data[SubmitDate]),ALL(PROdat_Data)),day))*30This gives the right result but is hardcoded to "Citrix XenApp - session - disconnect". The table is a top 20 so will have different rows every time Do you know how I could pass a variable into it to replace the "Citrix XenApp - session - disconnect" part of the code with whatever my row value is?- V-lianl-msft
Community Support
Hi Anonymous ,
I am not clear about your data model. Can you share a sample pbix or paste data and [created]formula?
Please remove any sensitive data before uploading.
Try to refer this thread:https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculating-Total-Average-ignoring-visuals-dimensions/td-p/808297
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.