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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Luce636
Frequent Visitor

slicer to select background tables

Hello,

is it possible to create a slicer, where you can select which table shall be used in all the other visuals?

Like i have tables with the data from every month and i want to compare two monst with each other.

in the slicer i want to be able to select what to compare. 

Maybe even without loading everything to the dataset.

4 REPLIES 4
v-zhengdxu-msft
Community Support
Community Support

Hi @Luce636 

 

Just as @Alex87 said that maybe you can try to use the field parameter.

File > Options > preview features > Field parameter:

vzhengdxumsft_0-1715233608910.png

Then restart the power bi desktop.

Here for your reference:

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnbasha33
Solution Sage
Solution Sage

@Luce636 

Yes, it's possible to create a slicer in Power BI where you can select which table to use in other visuals. This can be achieved using a disconnected slicer or a table slicer with dynamic table selections.

Here's how you can do it using a disconnected slicer:

1. **Create a New Table**: Create a new table in Power BI Desktop with a list of tables that you want to compare. You can manually enter the table names or load them dynamically using DAX.

2. **Create a Slicer**: Insert a slicer visual onto your report canvas and connect it to the new table you created in step 1. This slicer will act as your selector for choosing the table.

3. **Use Selected Table in Other Visuals**: In other visuals where you want to use the selected table, use DAX measures or calculated columns to dynamically reference the selected table based on the slicer selection.

Here's an example of how you can use a DAX measure to dynamically reference the selected table:

```DAX
SelectedTableData =
SWITCH (
SELECTEDVALUE('TableSelector'[TableName]),
"Table1", SUM('Table1'[Value]),
"Table2", SUM('Table2'[Value]),
// Add additional cases for each table you want to compare
BLANK()
)
```

In this example, 'TableSelector' is the name of the table containing the list of tables, and 'TableName' is the column containing the table names. You can replace "Table1", "Table2", etc., with the actual table names in your dataset.

By selecting a table in the disconnected slicer, the other visuals will dynamically adjust their data based on the selected table.

Using a disconnected slicer allows you to compare different tables without loading all the data into the dataset. However, keep in mind that this approach works well for comparing a few tables, but it may become less practical with a large number of tables or if the tables have significantly different structures.

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

for this i need to load all the Tables to the Model right? 

Is it possible to select the table and then a query runs and loads the data to the model?

Alex87
Solution Specialist
Solution Specialist

It looks like an use case for field parameters. If you need additional help, please provide additional information, like sample data, example of expected output, things you tested but did not work. If my reply answered your needs, please mark my reply as the solution. Thanks

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.