Forum Discussion
Issue in using "selectedvalue" function for filtering another table
- Anonymous1 year ago
Hi asadnsit ,
Thanks for the reply from bhanu_gautam .
As I understand it, you want to filter Emp_Master to present data based on the selected date in the slicer on Date_Table, right?
The values obtained using the slicer object in the report view cannot affect the calculated columns, calculated tables created in the data view. As a workaround, you can use measure to filter data dynamically instead of creating calculated tables.
Create a measure:
Emp_master_filtered = CALCULATE( COUNTROWS(Emp_Master), FILTER( Emp_Master, Emp_Master[DOJ] <= [Selected_date] && Emp_Master[DOR] >= [Selected_date] ) )Add Emp_master_filtered to the filter pane and set the filter rule with Emp_master_filtered = 1.
Filter the date in Slicer and the final page result is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi asadnsit ,
Thanks for the reply from bhanu_gautam .
As I understand it, you want to filter Emp_Master to present data based on the selected date in the slicer on Date_Table, right?
The values obtained using the slicer object in the report view cannot affect the calculated columns, calculated tables created in the data view. As a workaround, you can use measure to filter data dynamically instead of creating calculated tables.
Create a measure:
Emp_master_filtered =
CALCULATE(
COUNTROWS(Emp_Master),
FILTER(
Emp_Master,
Emp_Master[DOJ] <= [Selected_date] &&
Emp_Master[DOR] >= [Selected_date]
)
)
Add Emp_master_filtered to the filter pane and set the filter rule with Emp_master_filtered = 1.
Filter the date in Slicer and the final page result is shown below:
The pbix file is attached.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Thanks alot for the solution --> Using Measure as a filter resolved my issue.