Forum Discussion

nish18_1990's avatar
nish18_1990
Helper III
1 year ago
Solved

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 :

 

 

CategorySub CategoryProfitLossSalesQuantity Q2countryCreated date
FurnitureChairs102010010China22/05/204
FurnitureTables102010020China23/05/2025
AutomobileCars122010030China21/01/2025
AutomobileBikes101070040China21/03/2025
FurnitureChairs102010013India21/01/2025
FurnitureTables32050022India21/02/2025
AutomobileCars103010054India21/01/2025
AutomobileBikes102010060India30/01/2025
FurnitureChairs102010030China22/01/2025
FurnitureTables92030029China23/05/2025
AutomobileCars104020088China21/03/2025
AutomobileBikes102010022China21/04/2025
FurnitureChairs102050021India12/1/2025
FurnitureTables102010033India12/1/2025
AutomobileCars205060054India21/01/2025
AutomobileBikes102010060India30/01/2025
FurnitureChairs102010030China22/01/2025
FurnitureTables102010029China23/05/2025
FurnitureSofa102010088China21/03/2025
FurnitureBed102010022China21/04/2025
FurnitureDining102010021India12/1/2025
FurnitureTables102010033India12/1/2025
FurnitureTables102010054India21/01/2025
FurnitureSofa152010060India30/01/2025
AutomobileCars1030100054India21/04/2025
AutomobileBikes102010060India30/06/2025
FurnitureChairs52010030China22/07/2025
FurnitureTables101020029China23/07/2025
FurnitureSofa102010088China21/03/2025
FurnitureBed102010022China21/04/2025
FurnitureDining202010021India12/1/2025
FurnitureTables102040033India12/11/2024
FurnitureTables102080054India12/10/2024
FurnitureSofa101010060India12/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 chart 

     

     

     

    If this answers your questions, kindly accept it as a solution and give kudos.

4 Replies

  • 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 chart 

     

     

     

    If this answers your questions, kindly accept it as a solution and give kudos.
  • v-dineshya's avatar
    v-dineshya
    Community 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
    Sales

    2. Create a Slicer Using this Table, Use MeasureSelector[Parameter] in a slicer

    1. Created a Table(MeasureSelector) for Parameter Selection

    Parameter
    Loss
    Sales

    2. 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])
    RETURN
    SWITCH(
        SelectedMeasure,
        "Sales", SUM('Table'[Sales]),
        "Loss",  SUM('Table'[Loss]),
        BLANK()
    )

    4. Create the Right Chart Measure

    Measure_Right =
    VAR SelectedMeasure = SELECTEDVALUE(MeasureSelector[Parameter])
    RETURN
    SWITCH(
        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-dineshya's avatar
      v-dineshya
      Community 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.