Forum Discussion

umutkaya79's avatar
umutkaya79
Icon for Helper I rankHelper I
3 years ago

Adding a value to a column from another tables column based on a selected slicer value

Hi,

 

I have 2 tables :   Table1 and Table2.  (they are connected with a 'zone_name' column)

 

Table1 columns

group (Also a slicer) 

zone_name

margin

 

Each group can have 1 or more zone_names. And each group has only one margin. 

Example

 

Group               Zone_Name                     Margin_

A                         NYC                                     3

A                         Arizona                                3

                       Arizona                                2

B                         SF                                         2

C                         Chicago                               1

C                         SF                                        1

C                         NYC                                     1

D                         LA                                        2.5

 

So when I use the filter (group), there is one or couple zone_names selected but there is only one Margin for each group. 

 

 

Table 2 Columns

zone_name               date                    AvgPrice   

NYC                       01/01/2023                 20 

NYC                       01/02/2023                 22 

Arizona                  01/01/2023                 30

Arizona                  01/02/2023                 35

SF                          01/01/2023                 18 

SF                          01/02/2023                 16

Chicago                 01/01/2023                 10

Chicago                 01/02/2023                 12

LA                          01/01/2023                 16

LA                          01/02/2023                 15

 

Group slicer(from Table1) is on the same page with the LineChart(from Table2). 

So everytime we make a selection from the Group slicer, it filters the chart based on the zone_name. So I can see the AvgPrice when I hover on the chart. If there are multiple zone_names are filtered then it aggregates them and display the average. 

 

If anyone knows how to add the margin to AvgPrice based on the selection on the Group slicer so I can display the total of margin+AvgPrice when I hover on the chart. 

 

 

Thank you 

 

 

 

 

 

 

 

 

1 Reply

  • Since your Zones are linked to multiple groups (with different margins) you cannot add "the"  margin unless you make the Group slicer single select.