Forum Discussion
Filter based on Table
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
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- Yaya19904 years agoFrequent Visitor
Yes when using, the selected value, it is showing it in the dax, but when i use switch command, i dont see any of my tables:
is this becuase Create a sum of Difference measure;
(Difference_Table1,Difference_Table2,Difference_table3,Difference_table4) are calculated columns not a measure.if they are columns what could be the solution? i would highly appreciate.