Forum Discussion
Parameter Value selection
Hi ,
How can i link two parameters together :
I created two clustered chart one on the left and one on the right .
I created two parameter to show Loss and Sales on the left chart and Quantity and Profit on right chart .
What i want is only one parameter for both charts for selection :
For example : If i select Sales in Parameter it should show Sales on the left chart and Quantity on the right chart .
If i select Loss in Parameter then it should show loss on left chart and profit on right chart .
Can this be done in Power BI ?
Data :
| Category | Sub Category | Profit | Loss | Sales | Quantity Q2 | country | Created date |
| Furniture | Chairs | 10 | 20 | 100 | 10 | China | 22/05/204 |
| Furniture | Tables | 10 | 20 | 100 | 20 | China | 23/05/2025 |
| Automobile | Cars | 12 | 20 | 100 | 30 | China | 21/01/2025 |
| Automobile | Bikes | 10 | 10 | 700 | 40 | China | 21/03/2025 |
| Furniture | Chairs | 10 | 20 | 100 | 13 | India | 21/01/2025 |
| Furniture | Tables | 3 | 20 | 500 | 22 | India | 21/02/2025 |
| Automobile | Cars | 10 | 30 | 100 | 54 | India | 21/01/2025 |
| Automobile | Bikes | 10 | 20 | 100 | 60 | India | 30/01/2025 |
| Furniture | Chairs | 10 | 20 | 100 | 30 | China | 22/01/2025 |
| Furniture | Tables | 9 | 20 | 300 | 29 | China | 23/05/2025 |
| Automobile | Cars | 10 | 40 | 200 | 88 | China | 21/03/2025 |
| Automobile | Bikes | 10 | 20 | 100 | 22 | China | 21/04/2025 |
| Furniture | Chairs | 10 | 20 | 500 | 21 | India | 12/1/2025 |
| Furniture | Tables | 10 | 20 | 100 | 33 | India | 12/1/2025 |
| Automobile | Cars | 20 | 50 | 600 | 54 | India | 21/01/2025 |
| Automobile | Bikes | 10 | 20 | 100 | 60 | India | 30/01/2025 |
| Furniture | Chairs | 10 | 20 | 100 | 30 | China | 22/01/2025 |
| Furniture | Tables | 10 | 20 | 100 | 29 | China | 23/05/2025 |
| Furniture | Sofa | 10 | 20 | 100 | 88 | China | 21/03/2025 |
| Furniture | Bed | 10 | 20 | 100 | 22 | China | 21/04/2025 |
| Furniture | Dining | 10 | 20 | 100 | 21 | India | 12/1/2025 |
| Furniture | Tables | 10 | 20 | 100 | 33 | India | 12/1/2025 |
| Furniture | Tables | 10 | 20 | 100 | 54 | India | 21/01/2025 |
| Furniture | Sofa | 15 | 20 | 100 | 60 | India | 30/01/2025 |
| Automobile | Cars | 10 | 30 | 1000 | 54 | India | 21/04/2025 |
| Automobile | Bikes | 10 | 20 | 100 | 60 | India | 30/06/2025 |
| Furniture | Chairs | 5 | 20 | 100 | 30 | China | 22/07/2025 |
| Furniture | Tables | 10 | 10 | 200 | 29 | China | 23/07/2025 |
| Furniture | Sofa | 10 | 20 | 100 | 88 | China | 21/03/2025 |
| Furniture | Bed | 10 | 20 | 100 | 22 | China | 21/04/2025 |
| Furniture | Dining | 20 | 20 | 100 | 21 | India | 12/1/2025 |
| Furniture | Tables | 10 | 20 | 400 | 33 | India | 12/11/2024 |
| Furniture | Tables | 10 | 20 | 800 | 54 | India | 12/10/2024 |
| Furniture | Sofa | 10 | 10 | 100 | 60 | India | 12/11/2024 |
Hi nish18_1990
Can you please try the below steps to get your results.
1. First Create a table as below.2. Create these four measures.
Total Loss = SUM(Data[Loss])Total Profit = SUM(Data[Profit])Total Quantity = SUM(Data[Quantity Q2])Total Sales = SUM(Data[Sales])3. Now create two measures for the results.For left-----------------Selected Left Metric =SWITCH(SELECTEDVALUE(ForSelection[Column1]),"Sales", [Total Sales],"Loss", [Total Loss],BLANK())For right---------------Selected Right Metric =SWITCH(SELECTEDVALUE(ForSelection[Column1]),"Sales", [Total Quantity],"Loss", [Total Profit],BLANK())Now use it in the chartIf this answers your questions, kindly accept it as a solution and give kudos.
4 Replies
- mdaatifraza5556Super User
Hi nish18_1990
Can you please try the below steps to get your results.
1. First Create a table as below.2. Create these four measures.
Total Loss = SUM(Data[Loss])Total Profit = SUM(Data[Profit])Total Quantity = SUM(Data[Quantity Q2])Total Sales = SUM(Data[Sales])3. Now create two measures for the results.For left-----------------Selected Left Metric =SWITCH(SELECTEDVALUE(ForSelection[Column1]),"Sales", [Total Sales],"Loss", [Total Loss],BLANK())For right---------------Selected Right Metric =SWITCH(SELECTEDVALUE(ForSelection[Column1]),"Sales", [Total Quantity],"Loss", [Total Profit],BLANK())Now use it in the chartIf this answers your questions, kindly accept it as a solution and give kudos.- nish18_1990Helper III
Thanks !
- v-dineshyaCommunity Support
Hi nish18_1990 ,
Thank you for reaching out to the Microsoft Community Forum.
Hi mdaatifraza5556 , Thank you for posting response in Community.
Hi nish18_1990 ,
please follow below steps.
1. Created a Table(MeasureSelector) for Parameter Selection
Parameter
Loss
Sales2. Create a Slicer Using this Table, Use MeasureSelector[Parameter] in a slicer
1. Created a Table(MeasureSelector) for Parameter Selection
Parameter
Loss
Sales2. Create a Slicer Using this Table, Use MeasureSelector[Parameter] in a slicer
3. Create the Left Chart Measure
Measure_Left =VAR SelectedMeasure = SELECTEDVALUE(MeasureSelector[Parameter])RETURNSWITCH(SelectedMeasure,"Sales", SUM('Table'[Sales]),"Loss", SUM('Table'[Loss]),BLANK())4. Create the Right Chart Measure
Measure_Right =VAR SelectedMeasure = SELECTEDVALUE(MeasureSelector[Parameter])RETURNSWITCH(SelectedMeasure,"Sales", SUM('Table'[Quantity Q2]),"Loss", SUM('Table'[Profit]),BLANK())5. select two bar charts.
For the Left Chart, use Sub Category on axis and Measure_Left as value.
For the Right Chart, use Sub Category on axis and Measure_Right as value.
Selecting Sales in slicer → Left: Sales count | Right: Quantity
Selecting Loss in slicer → Left: Loss count | Right: Profit
output:
select the left chart and in Visual settings-> format option-> X-axis-> select "Invert range" set to "ON"
please refer output snap and PBIX file.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
- v-dineshyaCommunity Support
Hi nish18_1990 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.
Thank you.