Forum Discussion
Need help - Change table visual based on value in slicer
Hello - How can I change the visual in the table based on the selection?
For eg:-
If I select client ABC (In SLicer), I want the table visual to show remark 1, remark 2, remark 3 along with the columns in green
and if I selected client XYZ (In SLicer) I want to show remark 5, remark 8, remark 9 along with the columns in green
Data
| InvoiceDate | ClientName | InvoiceNumber | InvoiceID | Remark 1 | Remark 2 | Remark 3 | Remark 5 | Remark 8 | Remark 9 |
| 8/17/2021 0:00 | ABC | 817064 | 926099 | 1 | 2 | 3 | A | B | C |
| 8/17/2021 0:00 | ABC | 817065 | 926101 | 4 | 5 | 6 | A | B | C |
| 8/17/2021 0:00 | ABC | 817068 | 926105 | 7 | 8 | 9 | A | B | C |
| 8/17/2021 0:00 | ABC | 817069 | 926107 | 10 | 11 | 12 | A | B | C |
| 8/17/2021 0:00 | XYZ | 817071 | 926169 | 13 | 14 | 15 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817077 | 926112 | 13 | 14 | 15 | 20 | 21 | 22 |
| 8/17/2021 0:00 | XYZ | 817078 | 926114 | 13 | 14 | 15 | 23 | 24 | 25 |
| 8/17/2021 0:00 | XYZ | 817087 | 926134 | 13 | 14 | 15 | 26 | 27 | 28 |
| 8/17/2021 0:00 | XYZ | 817088 | 926136 | 13 | 14 | 15 | 29 | 30 | 31 |
Result - If I select Client Name ABC
| InvoiceDate | ClientName | InvoiceNumber | InvoiceID | Remark 1 | Remark 2 | Remark 3 |
| 8/17/2021 0:00 | ABC | 817064 | 926099 | 1 | 2 | 3 |
| 8/17/2021 0:00 | ABC | 817065 | 926101 | 4 | 5 | 6 |
| 8/17/2021 0:00 | ABC | 817068 | 926105 | 7 | 8 | 9 |
| 8/17/2021 0:00 | ABC | 817069 | 926107 | 10 | 11 | 12 |
| 8/17/2021 0:00 | XYZ | 817071 | 926169 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817077 | 926112 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817078 | 926114 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817087 | 926134 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817088 | 926136 | 13 | 14 | 15 |
Result - If I select client name XYZ
| InvoiceDate | ClientName | InvoiceNumber | InvoiceID | Remark 5 | Remark 8 | Remark 9 |
| 8/17/2021 0:00 | ABC | 817064 | 926099 | A | B | C |
| 8/17/2021 0:00 | ABC | 817065 | 926101 | A | B | C |
| 8/17/2021 0:00 | ABC | 817068 | 926105 | A | B | C |
| 8/17/2021 0:00 | ABC | 817069 | 926107 | A | B | C |
| 8/17/2021 0:00 | XYZ | 817071 | 926169 | 13 | 14 | 15 |
| 8/17/2021 0:00 | XYZ | 817077 | 926112 | 20 | 21 | 22 |
| 8/17/2021 0:00 | XYZ | 817078 | 926114 | 23 | 24 | 25 |
| 8/17/2021 0:00 | XYZ | 817087 | 926134 | 26 | 27 | 28 |
| 8/17/2021 0:00 | XYZ | 817088 | 926136 | 29 | 30 | 31 |
Hi gauravnarchal ,
I test two ways to achieve it.
1. Add bookmarks.
Referencing: https://www.youtube.com/watch?v=FBEF1xMxxEE
2. Unpivot columns.
- Unpivot columns in Power Query Editor.
- Create a calculation table.
ClientName = DISTINCT('Table'[ClientName])- Create the following measures.
Measure = IF( SELECTEDVALUE(ClientName[ClientName]) = "ABC", COUNTROWS( INTERSECT( CALCULATETABLE( VALUES('Table'[Attribute]), FILTER( 'Table', 'Table'[Attribute] in {"Remark 1", "Remark 2", "Remark 3"} ) ), DISTINCT('Table'[Attribute]) ) ), COUNTROWS( INTERSECT( CALCULATETABLE( VALUES('Table'[Attribute]), FILTER( 'Table', 'Table'[Attribute] in {"Remark 5", "Remark 8", "Remark 9"} ) ), DISTINCT('Table'[Attribute]) ) ) )RemarkValue = MAX('Table'[Value])- Filter the matrix by Measure.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandakSuper User
gauravnarchal , I think you need bookmarks and button for that. Slicer might not help
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
- v-kkf-msftCommunity Support
Hi gauravnarchal ,
I test two ways to achieve it.
1. Add bookmarks.
Referencing: https://www.youtube.com/watch?v=FBEF1xMxxEE
2. Unpivot columns.
- Unpivot columns in Power Query Editor.
- Create a calculation table.
ClientName = DISTINCT('Table'[ClientName])- Create the following measures.
Measure = IF( SELECTEDVALUE(ClientName[ClientName]) = "ABC", COUNTROWS( INTERSECT( CALCULATETABLE( VALUES('Table'[Attribute]), FILTER( 'Table', 'Table'[Attribute] in {"Remark 1", "Remark 2", "Remark 3"} ) ), DISTINCT('Table'[Attribute]) ) ), COUNTROWS( INTERSECT( CALCULATETABLE( VALUES('Table'[Attribute]), FILTER( 'Table', 'Table'[Attribute] in {"Remark 5", "Remark 8", "Remark 9"} ) ), DISTINCT('Table'[Attribute]) ) ) )RemarkValue = MAX('Table'[Value])- Filter the matrix by Measure.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.