Forum Discussion
Aggregate multiple measures from selecting multiple values of a slicer
Hi, thanks in advance for any help with this situation. We need to calculate the sum (aggregation) of selecting multiples values of a slicer (when each slicer item represent a sum of a column of a table).
The current situation is like this: We current can display in a line chart each slicer item separately (selecting one at a time), using a disconected table as a parameter, and creating a measure (because each item of the slicer represent a column of a table (Table1) with our data):
measure = SWITCH(VALUES('disconected_table_name'[disconected_table_column]), "disconected_table_item1", SUM(Table1[v1]),"disconected_table_item2", SUM(Table1[v2]), ... the same for all the rest of the values...Although the same achivement could be done with firstnonblank() or min() insted of values().
What I will very thankfull is a way of achive the agregation/sum of selecting multiple items in the slicer so they can be displayed in the chart.
Thank yu
xv
3 Replies
- Eric_ZhangMicrosoft Employee
Try a measure as below.
Measure = IF ( ISFILTERED ( disconected_table_name[item] ), SUMX ( FILTER ( ALL(Table1), CONTAINS ( VALUES ( disconected_table_name[item] ), disconected_table_name[item], Table1[item] ) ), Table1[amt] ), 0 )By the way, why not create a proper relationship between those two tables?
- xvFrequent Visitor
Ty Eric for your time. Your solution is quiet right, but my problem is that table1 represent a table where each item is a columnof another table.
What i need is the same as this example (http://breaking-bi.blogspot.cl/2016/06/power-bipowerpivot-using-slicers-to.html), but whent i click in more than 1 slicer item, get the sum.
- Eric_ZhangMicrosoft Employee
xv wrote:
Ty Eric for your time. Your solution is quiet right, but my problem is that table1 represent a table where each item is a columnof another table.
What i need is the same as this example (http://breaking-bi.blogspot.cl/2016/06/power-bipowerpivot-using-slicers-to.html), but whent i click in more than 1 slicer item, get the sum.
What do you mean "item is a column of another table", could you provide a sample pbix?