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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Malina36
Frequent Visitor

One slicer for two tables

Hello,

 

I have two tables in PBI; actual values and target values. The values should be shown in a bar chart. The relationship is based on date. I want to add a few slicers to that, they come from target values. The fields are the same in both tables. My problem is, the slicers dont affect the whole chart, only the target part. I tried to delete date relationship and establish relationships by fields i want to have in slicers. It didnt help. I tryied to make table with unique values, didnt work as well. Any ideas?

1 ACCEPTED SOLUTION

Double check that you are creating the many-to-one in the right direction. It sounds silly, but it is easy to choose one-to-many rather than many-to-one, or vice versa, as it depends on which order the tables are listed in the relationship window. I know I've made that mistake before.

View solution in original post

10 REPLIES 10
vivek31
Resolver II
Resolver II

HI @Malina36 ,

1) you can create a dimension table 
Dim_Slicer_Table = DISTINCT(UNION(VALUES(TargetValues[SlicerField]), VALUES(ActualValues[SlicerField])))
Replace SlicerField with the column name you want to filter by.

2) create relationships
    connect Dim_Slicer_Table  to actual values
    connect Dim_Slicer_Table  to actual values

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

 

Thank you



 

 



 

Thank you. It doesnt work as it should. Probably bc of relationships. I can only habe m:n relationship. One to many is not possible.

johnt75
Super User
Super User

Create a new table with the distinct values from both the targets and actuals,

Slicer Table =
DISTINCT (
    UNION ( DISTINCT ( 'Targets'[Column] ), DISTINCT ( 'Actuals'[Column] ) )
)

Link this to both the targets and actuals in one-to-many relationships, and you can now use values from the new table in slicers and visuals.

It is not possible to make the relationship one to many. Error is saying, target table contains double values. The calculation for target values shows total sum, the same number for each year. No idea how to handle that.

can you share a PBIX? you can post a link to Google Drive, OneDrive etc.

Not really, its a lot of intern data. But i will try to answer every question you may have. Generlly it doesnt work. I have tried a lot of measures and i always get wrong numbers. Normally it should be easy, unique table for slicer and thats it. But nothing works 😭

what sort of values are you trying to slice by? are they text values, whole numbers, decimals ?

I want to slice by text, like country, company. For each I did separate unique table (also every thing in one table). Both doesnt work. On x achsis i have years. Thanks for your time 😊

Double check that you are creating the many-to-one in the right direction. It sounds silly, but it is easy to choose one-to-many rather than many-to-one, or vice versa, as it depends on which order the tables are listed in the relationship window. I know I've made that mistake before.

Thanks 🙂  i will look in to that. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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