Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have requirment as follow:
we have a table :
A1 | A2 | A3 | M1 | M2 | M3 |
we need to give to user possibility to select A1, A2,A3 to show in the table or not.
I found this link :https://community.powerbi.com/t5/Desktop/Select-columns-to-show-on-table-visual/m-p/606363/highlight...
But in this link the attributes(A1,A2,A3 )were put rows, but I need them as column.
I appreciate any suggestion and help on this problem.
Thank you.
Regards,
Matin
Solved! Go to Solution.
@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:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thank you @AllisonKennedy for the solution .
I follow the steps but the value of measure is always 0! and the solution does not work.
here are my tables :
and I created measure as follow:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy , even with Top 1 does not work.
here is the result, as you could see the measure returns 1 for A1,A2,A3 ( which I want to be selacteble), and 0 for M1, M2 and M3.
and infact Slider does not doing anything .
for sure I did something wrong but I could not find it 😞
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous , see if this can help
https://www.youtube.com/watch?v=6jeSIRpjv0M
for measure
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
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 Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
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 Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-lionel-msft ,the steps which you mentioned is what I did( as I explained before), but the result is not similar to what I want, I need the result as follow:
C | A1 | A2 | A3 | M1 | M2 | M3 |
Regards,
Matin
@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:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |