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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
michal_boro
Frequent Visitor

Selected Value in slicer as table measure

Hello,

 

I have to insert into below function as a table measure all values that are selected in slicer.

So for example, i ve selected on slicer yellow, green and black and as variable named  [selectedbyfiltervalue] i ve got results as a table expresion {yellow, green, black}

 

    VAR __FilterTable =
        TREATAS(
                       [selectedbyfiltervalue],
                        'Table'[Column]
                       )
 
Can you help please? 🙂
6 REPLIES 6
michal_boro
Frequent Visitor

TableResult = 
    VAR __DS0FilterTable = 
		TREATAS(
			{	"STAR 21.08.06.##",
				"STAR 21.08.20.##"},
			'Distinct Fix'[fixVersions.name BLANK]
		)
	VAR __DS0FilterTable2 = 
		TREATAS(
			{	"STAR 21.12.10.##",
				"STAR 22.01.07.##"},
			'Distinct Affected'[AffectedVersion BLANK]
		)
	VAR __DS0Core = 
		SUMMARIZECOLUMNS(
			ROLLUPADDISSUBTOTAL('SLS Agile'[Key], "IsGrandTotalRowTotal"),
			__DS0FilterTable,
			__DS0FilterTable2,
			"OR_Distinct", 'SLS Agile'[OR Distinct]
		)
	VAR __DS0PrimaryWindowed = 
		TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'SLS Agile'[Key], 1)
Return
SELECTCOLUMNS(__DS0PrimaryWindowed,'SLS Agile'[Key])

 

 I ve got this code which BI generated for me and in general it retuns proper values, but what i wanted to do is to put instead of TREATAS, the realtime values that i select by slicers. So if i change values in slicers, data in that TableResult measure also change in real time.

 

michal_boro_0-1708604374003.png

 

TableResult is normal measure not calculation table.

danextian
Super User
Super User

Hi @michal_boro ,

 

To confirm, are you attempting to generate a calculated table in which the outcomes of chosen values in a slicer are incorporated as new rows? If this is your intent, I must clarify that it isn't possible. Calculated tables refresh exclusively when the primary data changes or when alterations are made to the formula itself, not in response to filtering in visuals. Consequently, slicer selections won't impact a calculated table. However, there might be a misunderstanding regarding your requirements. Could you provide further details, including a functional data sample (not in image form), and outline your expected outcomes using that data?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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 or follow my page on Facebook @DAXJutsuPBI.

I ve prepared .pbix sample but dont know how to attacht it to repley 😞 i ve got pop up informing .pbix file is not supported

Anonymous
Not applicable

Hi,  @michal_boro 

You can put your files in a dropbox, onedrive or googledrive folder and share the link with the community. 

Best Regards,
Yang
Community Support Team

Daniel29195
Super User
Super User

@michal_boro 

 

you can use the concatenatex function . 

 

measure = 

var s =  values( tbl_name[col_name]) 

 

return

concatenatex ( s ,  tbl_name[col_name]) , ",")

 

 

let me know if that works for you . 

 

 

If this answers your question  ,  mark it as the solution so can you can help  other people in the community find it easily .

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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