Forum Discussion
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 :
| 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 |
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]))RETURNIF(V1=1,MAX('List MU'[Market Unit]),IF(V1=23,"All Markets","Multiple Markets"))
2 Replies
- amitchandak
Super User
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
Post 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]))RETURNIF(V1=1,MAX('List MU'[Market Unit]),IF(V1=23,"All Markets","Multiple Markets"))