Forum Discussion
Filter based on Table
Hi Yaya1990 .
You can create a custom table using 'Enter Data' and add your table names in there, drag a slicer and add the custom table values in it i.e. now in your slicer you will have 4 different table names.
Now in your measure pass those tables values in the calculation using SELECTEDVALUE.
For example,
test=
var a=SELECTEDVALUE(Table[TableNames])
return
SWITCH(TRUE(),a=Employee_Table,[Employee_Count],b=Sales_table,[SumSales],c=IT_Table,[CountMeasure],d=Healthcare,[Measure])
Now add your test measure inside a KPI or any other visual you want
Please let me know if it works.
Thanks,
Sanket
If this post helps, then mark it as 'Accept as Answer' and give it a thumbs up
Hi, let me give you my table names
Suppose,
Table 1
Table 2
Table 3
Table 4
Each table has a column named as difference where i have calculated a value.
I need to do this (Difference Table 1 + Difference Table 2 + Difference Table 3 + Difference Table 4) and then show it on a bar chart.
once this is done, i need slicer filter, where if i click Table 1, it only shows me the data for table 1 and hide other information.
Please help me if you can as this is very imp dashbaord, and let me know if you need more clarification.
Regards,
Fahad
- Anonymous4 years agoNot applicable
Click on Enter Data and create a custom table.
Let's say table test; give a column name as 'column_name' and under that provide your 4 table names i.e. Table1 to Table4.
Add this table to a slicer visual.
Create a sum of Difference measure;
Sum_Diff=Difference_Table1+Difference_Table2+Difference_table3+Difference_table4.
Create a measure which will show your difference values;
Difference=
var a=Test['column_name']
return
SWITCH(TRUE(),
a=Table1,[Difference_Table1],a=Table2,[Difference_Table2],a=Table3,[Difference_Table3],a=Table4,[Difference_Table4],[Sum_Diff])
Let me know if it works.
If this post helps, then mark it as 'Accept as Answer' and give it a thumbs up- Yaya19904 years agoFrequent Visitor
i cannot get the first line working (var a=Test['column_name']), it is not reading the table, am i doing something wrong
- Anonymous4 years agoNot applicable
If you have properly created the custom table using 'Enter Data' then you won't have any problem passing Table name inside the SELECTEDVALUE function.
Cross check again.
Thanks,
Sanket