Forum Discussion
Use CalculateTable as reference for measure
Good afternoon. It was suggested to me to take a measure and remove the VAR for calculated table and create an actual Calculated Table then reference that for the remainder. It would help reduce the processing time and provide quicker access to the data. However, when I took the Calculated Table section and moved it, I am struggling with trying it to a date table and getting the results I want.
Here is my original measure:
I moved the entire VAR CustomersWithActiveDate to it's own calculated table and then replaced Active Customers with
But my results put a tick mark in every month prior to their first order and I can't seem to build a relationship between the ActiveThrough and DateTable.
Any advice? What am I missing?
4 Replies
- lbendlin
Super User
A calculated table outside a measure no longer has filter context. That means things like "ALLSELECTED" become meaningless.
You will have to slightly shift your approach to create that calculated table taking the entire data model into account. The positive part is that you only have to do that once, and your measures will then benefit from the performance gain.
- ciken
Resolver I
Thanks - do you have a suggestion of how to do that? I can obviously remove the Variable around the calendar as well as the AllSelected on the customer table.
But then when I go to write the measure - how do I ensure it works properly with that calculatetable pulled out?- lbendlin
Super 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 or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- ciken
Resolver I
lbendlin
Hoping this is a small enough file to give you data enough to help.
Thanks!
Corey
Active Subscribers.pbix