Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cristianml
Post Prodigy
Post Prodigy

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
1 ACCEPTED SOLUTION

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"))

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
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])))

 

 

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"))

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.