Forum Discussion

cmpbn's avatar
cmpbn
New Member
2 years ago
Solved

Filter columns from two or more tables

I have two tables Employee and Department, and the common column is deptno.
I have been trying to calculate the number of employees from deptno 20 whose earns more than 550.
I palyed with the FILTER function, but its not letting me filter columns from two different tables

 

EMPNODEPTNOSAL

SZ190

10459
SZ18120600
SZ87620587
SZ56820545
SZ73230390


Department Table

DEPTNOCITY
10LA
20CHICAGO
30JACKSONVILLE


Thanks,
Nawaz

6 Replies

    • cmpbn's avatar
      cmpbn
      New Member

      Thanks for the reply,  I miss typed my previous question.
      I wanted to find out the number of employees from CHICAGO area who earns more than 550

    • cmpbn's avatar
      cmpbn
      New Member

      Thanks, it worked.
      I just realised this could have been done using CALCULATE function which reestablishes the relation ship between the tables.

    • cmpbn's avatar
      cmpbn
      New Member

      Instead of manually passing city = chicago and sal > 500.
      is there a way to to parameterized the hard coded values?

      • NaveenGandhi's avatar
        NaveenGandhi
        Icon for Memorable Member rankMemorable Member

        cmpbn 

        For City you can use a slicer of city name[create a city  dim table and keep this disconnected], For salary create a numeric parameter. Use selectedvalue function to pass both of these to the measure. It will look something like below.

        calculate(count(emp),city=selected value of(city_fromdim table)&&salary>selectedvalue(numeric_parameter))