Forum Discussion
Re-Calculate table on filter change
Hi!,
I'm trying to get the CDF and PDF for a file in a table; my table has ten columns, and I need to summarize 5 of them and get my calculations done on the new summary table.
First, I created this summary table,
SummaryTable = CALCULATETABLE(SUMMARIZE(Table, Table[count_success], Table[subscriber_id], Table[country], Table[product], Table[StartDate]))
Then, I created two new columns CDF:
CDF_ =
VAR avg_ = AVERAGE(SummaryTable[count_success])
VAR std_ = STDEV.P(SummaryTable[count_success])
RETURN
NORM.DIST(SummaryTable[count_success], avg_, std_, TRUE())
And PDF:
PDF =
VAR avg_ = AVERAGE(SummaryTable[count_success])
VAR std_ = STDEV.P(SummaryTable[count_success])
RETURN
NORM.DIST(SummaryTable[count_success], avg_, std_, FALSE())
My problem is in the filtration:
After calculating the new table, do I have to create new relationships between the SummaryTable and the other dimension tables, like countries and products? Because when I change the filters, I see the original table data being changed while the summary stays the same.
When I created the relationship between the Summary Table and dimensions, I could filter. However, the CDF and PDF are not recalculated based on the filtered data; they stay the same, and only the filtered values disappear.
I appreciate any feedback.
- Anonymous2 years ago
The PDF and CDF were created as new columns, in this way they weren't being recalculated in filters change, to overcome this I created them as measures in a third table and used those measures in the visuals.
3 Replies
- AnonymousNot applicable
Hi Anonymous ,
There is no need to create a relationship. Are you sure you are using the fields in the calculation table? You can check the results below:
Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi Anonymous,
thanks for your reply, I tired the same, and I do also calcualte the AVG and STD within the summary table but they aren't being changed on the summary table.
- AnonymousNot applicable
The PDF and CDF were created as new columns, in this way they weren't being recalculated in filters change, to overcome this I created them as measures in a third table and used those measures in the visuals.