Forum Discussion
Column selection based on Filter
- Anonymous6 years ago
Hi Farwest ,
Please try to complete the following steps to achieve your requirement:
1. Create one dimension table for name field(Group 1,Group 2,Group 3 etc. )
Create table Groups
2. Create the relationship between two tables using field "Group" in Groups table and "Name" field in Table
Create relationship between dimension and fact table
3. Create a measure and drag the related fields onto the visual as below screen shot
Measure = IF(ISFILTERED('Groups'[Group]),MAX('Table'[Name 2]),MAX('Table'[Name 1]))Create measure and table visual
Best Regards
Rena
Thanks amitchandak
This actually works better, but I still have a problem.
This works when I define the selected Filter Value "Selected", but I am trying to:
if only one filter is selected then get 'Table' [Name 1] otherwise (all selected) get 'Table' [Name 2] (this is a single filter selection anyway)
Farwest ,
Try like
IF(isfiltered('Table' [Name]) && HASONEFILTER('Table' [Name]);
SWITCH(SELECTEDVALUE('Table' [Name]);
"Selected"; MAXX('Table' [Name 1]);
MAXX('Table' [Name 2])
);
MAXX('Table' [Name 2])
)
- Farwest6 years agoFrequent Visitor
Tried out as well but not really reaching the expected result.
I am adding more details to better exlain the case, the result I have today is a bit different.
When no filter is selected group 3 is still showing Name 1 table where it should be Name 2 as per the DAX on previous post.
Every time one group is filtered I would liket o get Table[Name 1]
Every time no filter is selected I would like to get Table [Name 2]
I have hundreds of groups so I don't want to enter them one by on in the SWITCH like SWITCH(SELECTEDVALUE('Table' [Name]);
"Group 1"; ...."Group 2";...- Anonymous6 years agoNot applicable
Hi Farwest ,
Please try to complete the following steps to achieve your requirement:
1. Create one dimension table for name field(Group 1,Group 2,Group 3 etc. )
Create table Groups
2. Create the relationship between two tables using field "Group" in Groups table and "Name" field in Table
Create relationship between dimension and fact table
3. Create a measure and drag the related fields onto the visual as below screen shot
Measure = IF(ISFILTERED('Groups'[Group]),MAX('Table'[Name 2]),MAX('Table'[Name 1]))Create measure and table visual
Best Regards
Rena