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
webportal
Impactful Individual
Impactful Individual

Pass the values of a slicer selection to a list variable

I have a calculated table with an expression like:

 

 

Table = 
VAR MyVar = {1;2;3}
...
RETURN
SELECTCOLUMNS(...)

This returns a table with a single column. The rows depend on the list defined manually in "MyVAR".

I'd like to pass the values of a slicer selection to that list.

Is this possible to do in Power BI Desktop? How?

Thanks in advance!

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

HI there,

Unfortunately calculated tables (and calculated columns) are computed at report refresh, so they are unable to make use of slicer selections or other filters within a report.

 

Depending on what you're trying to do, another option may be to build the table as a variable within one or more measures (which can take into account slicer selections) and use that table somehow within those measures.

 

Something like the feature you're looking for (i.e. creating a table function that responds to filter context) was discussed here recently. While it can't be done in Power BI Desktop right now, it can be done in Analysis Services 2017 or Azure Analysis Services, and with any luck it wil be possible in Power BI Desktop in the future.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

HI there,

Unfortunately calculated tables (and calculated columns) are computed at report refresh, so they are unable to make use of slicer selections or other filters within a report.

 

Depending on what you're trying to do, another option may be to build the table as a variable within one or more measures (which can take into account slicer selections) and use that table somehow within those measures.

 

Something like the feature you're looking for (i.e. creating a table function that responds to filter context) was discussed here recently. While it can't be done in Power BI Desktop right now, it can be done in Analysis Services 2017 or Azure Analysis Services, and with any luck it wil be possible in Power BI Desktop in the future.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

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.