Forum Discussion
How could implement selecting columns which shows in table dynamically?
- 6 years ago
Anonymous It is a bit unconventional but you can try to unpivot all the A and M columns, so that you are left with:
C, Attribute, Value
Also create a disconnected table (no relationships to current data model) for the M values that you want user to select. I called this table Slicer.
Slicer:
Select M1 M2 M3 Then create the matrix with C in Rows, Attribute in Columns, Value in Values.
Finally, create this measure to filter the Attribute:
ShowColumns =Var SlicerSelection = VALUES(Slicer[Select])Var AlwaysShow = {("A1"), ("A2"), ("A3")}Var ShowValues = UNION(SlicerSelection, AlwaysShow)RETURNIF(SELECTEDVALUE('Table'[Attribute]) IN ShowValues, 1, 0)Put a filter on the visual for Attribute using Top N and use the ShowColumns measure as the By Value to filter for Top 1.
Thank you amitchandak , it is very useful, but still there is a problem.
I need to make A1,A2,A3 selectable and always show M1 and M2 and M3 .
But when I added M1,M2 and M3 to Matrix as columns , they don't add to matrix.
do you have any suggestion to solve this problem?
sorry maybe my questions are so basic, because I am beginners in Power BI
Regards,
Matin
- v-lionel-msft6 years ago
Community Support
Hi Anonymous ,
What problem have you met? You just need to do like this.
1. Unpivot the columns.
2. Add the columns to the matrix.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Thanks v-lionel-msft for the explanation,But this is not what I need.
I have a table like this:
C A1 A2 A3 M1 M2 M3 and I need to show it as it is , but I need to put a slider in order to give possibility to select or not select A1,A2,A3.
I did unpivot the columns A1,A2 and A3.
I put attribute as a slider and in Matrix:
C,M1,M2,M3 as ROWS
Attribute as columns
Values: first value
But My result is like this:
C M1 M2 M3 A1 A2 A3 and A1,A2 and A3 are selectable.
Do you have any suggestion in order to solve my problem?
Thank you in advance.
Regards.
Matin
- v-lionel-msft6 years ago
Community Support
Hi Anonymous ,
Try to unpivot A1, A2 and A3 columns, then, you can get such a table.
And add columns to the matrix.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.