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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
RemiAnthonise
Helper V
Helper V

Show workername with single selection, show 'All' with multiple select

With the following DAX I can show a label if one value is selected. 

Workername = "Label" & " " & 'Name'[Name]. If multiple values are selected it shows the first name. I'm trying to create a simple formula which gives me 'All' (or something like that) of no selection / multiple values are selected. 
 
I made a sample file here. I think it must be something like this:
IF (DISTINCTCOUNT('Name'[Name]) > 1; "All"; "Accountmanager" & " " & 'Name'[Name]) 
or 
IF (SELECTEDVALUE('Name'[Name]) > 1; "All"; "Accountmanager" & " " & 'name'[Name])
 
Thanks for your help.
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi,

 

Please try this code:

Workername = 
SWITCH(TRUE();
ISFILTERED('Name'[Name]) = FALSE() && DISTINCTCOUNT('Name'[Name]) > 1; "All";
ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) > 1; "Multiple accountmanagers selected";
"Accountmanager" & " " & VALUES('Name'[Name]))

View solution in original post

Anonymous
Not applicable


@RemiAnthonise wrote:

Nice one, thanks a lot!


 
Workername = 
SWITCH(TRUE();
(ISFILTERED('Name'[Name]) = FALSE() && DISTINCTCOUNT('Name'[Name]) > 1) || (ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) = CALCULATE(DISTINCTCOUNT('Name'[Name]);ALL('Name'[Name]))); "All";
ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) > 1; "Multiple accountmanagers selected";
"Accountmanager" & " " & VALUES('Name'[Name]))

I noticed that the DAX formula is actually wrong. bcus if you select all values through a slicer it would have ended up with multiple selected. I've added the bold part which solves that problem.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,

 

Please try this code:

Workername = 
SWITCH(TRUE();
ISFILTERED('Name'[Name]) = FALSE() && DISTINCTCOUNT('Name'[Name]) > 1; "All";
ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) > 1; "Multiple accountmanagers selected";
"Accountmanager" & " " & VALUES('Name'[Name]))

Nice one, thanks a lot!

Anonymous
Not applicable


@RemiAnthonise wrote:

Nice one, thanks a lot!


 
Workername = 
SWITCH(TRUE();
(ISFILTERED('Name'[Name]) = FALSE() && DISTINCTCOUNT('Name'[Name]) > 1) || (ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) = CALCULATE(DISTINCTCOUNT('Name'[Name]);ALL('Name'[Name]))); "All";
ISFILTERED('Name'[Name]) = TRUE() && DISTINCTCOUNT('Name'[Name]) > 1; "Multiple accountmanagers selected";
"Accountmanager" & " " & VALUES('Name'[Name]))

I noticed that the DAX formula is actually wrong. bcus if you select all values through a slicer it would have ended up with multiple selected. I've added the bold part which solves that problem.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors