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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.