Dax: How to apply filter function on a column?

563 views Asked by At

I am trying to create a report and i have a table of data which is having project name,pro id,emp name,id, location(off/onsite) like all are basic info about the each employee.

I am using RLS so that when ever a person can login to this report he can view their own personal data.

When i login to this report, then i can able to see the project id's which are having under my list. enter image description here

Now i am trying to show the basic emp details in a table like as emp name, id, role and location. But in table i can see the only value of the person who login to the report. enter image description here

I cant see the rest of employees which are belong to the same project id and their info in table.

I have tried a dax using calculated table funtion as below for only single pro id by using NEW TABLE option.

Table = 
CALCULATETABLE(
SUMMARIZE('Basic Info','Basic Info'[Employee ID],'Basic Info'[Employee Role],'Basic Info'[Employee Name]),
FILTER('Basic Info','Basic Info'[Project ID]="C.0010978"
))

And it is giving the output for that perticular project. But if i remove that hard coded pro id and put column of the pro id from table as

Table = 
CALCULATETABLE(
SUMMARIZE('Basic Info','Basic Info'[Employee ID],'Basic Info'[Employee Role],'Basic Info'[Employee Name]),
FILTER('Basic Info','Basic Info'[Project ID]='Basic Info'[Project ID]
))

then it is not filtering the values as the projects filtered from the slicer as show in above image.

It is showing all the emp names and their data.

Any suggestions.

Thanks in advance,

Mohan V.

1

There are 1 answers

0
Alexis Olson On

You cannot use slicer values in a calculated column. Calculated columns are evaluated during the data load and are not responsive to any visuals, filters, or slicers.

You may want to try using a measure instead of a calculated column.


Try searching the web for "power bi column vs measure" for more info on how each one is used.