Forum Discussion

radhasri_0505's avatar
radhasri_0505
New Member
4 years ago
Solved

passing variable selected from slicer to the table expression in DAX

selectedJob = SELECTEDVALUE(EMP[JOB]) -- This is Measure

Table1 = FILTER(SELECTCOLUMNS(EMP,"@EMPNAME",EMP[ENAME],"@JOB",EMP[JOB]),[@JOB]="CLERK")

 

This is successfully creating the table.However when I am replacing CLERK with SELECTEDVALUE(EMP[JOB]). This is not working. Any reason. From last 4 days I am struggling with this problem. Please suggest is there any alternate for this?

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi radhasri_0505 ,

     

    What you are asking for is not possible as Power BI is currently designed. Slicers cannot affect calculated tables. Calculated columns and calculated tables are evaluated once when the data is first loaded and are static until the data is refreshed.

    However, you can get the table visual you want in a much simpler manner by writing the appropriate measure and putting that in the table instead of defining an entirely separate table.

     

    Best Regards,

    Stephen Tao

     

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

     

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi radhasri_0505 ,

     

    What you are asking for is not possible as Power BI is currently designed. Slicers cannot affect calculated tables. Calculated columns and calculated tables are evaluated once when the data is first loaded and are static until the data is refreshed.

    However, you can get the table visual you want in a much simpler manner by writing the appropriate measure and putting that in the table instead of defining an entirely separate table.

     

    Best Regards,

    Stephen Tao

     

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