Forum Discussion

cristianml's avatar
cristianml
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Create a measure for multiple selection and all selected values

Hi,

 

could you help me to create a measure that ruturn an string depending of the selection?

 

IF is one value of the column is selected then that value from the column else 

IF 2 or more values from the column are selected then  "MULTIPLE VALUES SELECTED" else

IF all values from the column are selected then  "ALL SELECTED"

 

How can I build this ? 

 

this will based on the column :

'List MU'[Market Unit]
 
Market Unit
Africa
AFS
ANZ
ASGR
Canada
Gallia
Greater China
Iberia
ICEG
India
Japan
Latin America
ME
Midwest
Nordic
Northeast
SEA
South
UK, Ireland
US Not Assigned
West
NOT ASSIGNED
United States
  • cristianml's avatar
    cristianml
    4 years ago

    Hi amitchandak ,

     

    Tables are connected and  calculate(sum(Table[Value])  is not what I was looking for.

    Finally I got the solution with the following measure:

     

    _Market Selection =
    VAR V1 = COUNTROWS(VALUES('List MU'[Market Unit]))
    RETURN
    IF(V1=1,MAX('List MU'[Market Unit]),IF(V1=23,"All Markets","Multiple Markets"))

     

2 Replies

  • cristianml , if the table are disconnected , if they are joined it should happen automatically

     

    calculate(sum(Table[Value]), filter(Table, Table[Market Unit] in values('List MU'[Market Unit])))

     

     

    • cristianml's avatar
      cristianml
      Icon for Post Prodigy rankPost Prodigy

      Hi amitchandak ,

       

      Tables are connected and  calculate(sum(Table[Value])  is not what I was looking for.

      Finally I got the solution with the following measure:

       

      _Market Selection =
      VAR V1 = COUNTROWS(VALUES('List MU'[Market Unit]))
      RETURN
      IF(V1=1,MAX('List MU'[Market Unit]),IF(V1=23,"All Markets","Multiple Markets"))