Forum Discussion
Anonymous
2 years agoNot applicable
Dynamically change table columns according to id
Hi all,
I need help to change the table headers or columns according to the parameter I input during embedding the power bi on my application with javascript API. So I have this filter on my frontend application
var IamAFilter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "sample_table",
column: "id"
},
operator: "In",
values: [1]
}
and let's say this is my sample_table or my data
| id | column1 | column2 | column3 | column4 | column5 | column6 |
| 1 | sample_data | sample_data | sample_data | sample_data | sample_data | sample_data |
| 2 | sample_data | sample_data | sample_data | sample_data | sample_data | sample_data |
| 3 | sample_data | sample_data | sample_data | sample_data | sample_data | sample_data |
| 4 | sample_data | sample_data | sample_data | sample_data | sample_data | sample_data |
and
I want to display on my table in power bi if ever my parameter is 1:
table graph in power BI:
| column1 | column2 | column6 |
| sample_data | sample_data | sample_data |
| sample_data | sample_data | sample_data |
| sample_data | sample_data | sample_data |
| sample_data | sample_data | sample_data |
I want to display on my table in power bi if ever my parameter is 2:
table graph in power BI:
| column2 | column5 |
| sample_data | sample_data |
| sample_data | sample_data |
| sample_data | sample_data |
| sample_data | sample_data |
these are just examples of the output. Basically I want the columns to change according to the parameter that I passed from my frontend application. Help please I am still new to power BI
2 Replies
- AnonymousNot applicable
just use slicer. you're welcome
- AnonymousNot applicable
I am not sure how the slicer would get the output i need.