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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
danextian
Super User
Super User

Measure to show current selection

I've been trying to do this but just can't get it right so I'm here again asking for your help. Thanks in advance.

 

how do i do this?

none or all selected = all categories are selected

two or more selected = multiple categories

one selected = category name

 

I can't the "multiple" selection part right. The card always  shows "all categories are selected". I wrote something like

measure = if(not(hasonevalue(column_name)),"all",values(column_name))






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu.
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @danextian,


>>I can't the "multiple" selection part right.

Measure not support show multiple values, if your select multiple values, you should merge them to one:

 

SelectItem = 
IF(COUNTROWS(ALL(User))=COUNTROWS(ALLSELECTED(User)),
	"All or None",//check all or none
	if(HASONEVALUE(User[First Name]),
		VALUES(User[First Name]),//single
		CONCATENATEX(VALUES(User[First Name]),[First Name],","))//mutiple
		)

 

Capture.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @danextian,


>>I can't the "multiple" selection part right.

Measure not support show multiple values, if your select multiple values, you should merge them to one:

 

SelectItem = 
IF(COUNTROWS(ALL(User))=COUNTROWS(ALLSELECTED(User)),
	"All or None",//check all or none
	if(HASONEVALUE(User[First Name]),
		VALUES(User[First Name]),//single
		CONCATENATEX(VALUES(User[First Name]),[First Name],","))//mutiple
		)

 

Capture.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

Thanks for your help. I was able to show "multiple". I used countrows(Tabe[User]) since I crossfilter using visuals and not through a User slicer. 






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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