Forum Discussion
Change data view of visual by parameter selection - possible with current table format?
My data table has a record for each year a customer product is purchased, with the monthly values in columns as shown below.
CUST-ID | PROD-ID | YEAR | SALES-JAN | SALES-FEB | PROFIT-JAN | PROFIT-FEB | QTY-JAN | QTY-FEB |
1175 | A7345 | 2021 | 23500 | 17750 | 5170 | 4082 | 7 | 5 |
1175 | A7345 | 2022 | 25250 | 19520 | 6270 | 5190 | 8 | 6 |
1175 | C3421 | 2021 | 13200 | 11200 | 5170 | 4082 | 4 | 3 |
1175 | C3421 | 2022 | 11000 | 9000 | 2200 | 1980 | 3 | 2 |
I would like to display the data in a visual, but with the ability to control the view.
CHOOSE VIEW: | SALES |
| PROFIT |
| QTY |
Selecting SALES would show the following example. If PROFIT or QTY are selected, the Customer, Product, and Year would stay with the monthly value columns changing to match the selection.
| SALES-JAN | SALES-FEB | SALES-MAR | SALES-APR |
1175 | 72950 | 57470 |
|
|
A7345 | 48750 | 37270 |
|
|
2022 | 25250 | 19520 |
|
|
2021 | 23500 | 17750 |
|
|
C3421 | 24200 | 20200 |
|
|
2022 | 11000 | 9000 |
|
|
2021 | 13200 | 11200 |
|
|
I have worked through various examples including Field Parameters but have not figured out if this is possible. Does the data table need modified in Power Query Editor to make it better suited to the results I want or is there another area I should research?
Thank you for any assistance.
1 Reply
- lbendlin
Super User
Definitely possible with Field Parameters but first you need to bring your data into a usable format by unpivoting.
Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523