Forum Discussion

xv's avatar
xv
Frequent Visitor
10 years ago

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_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    xv

     

    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?