Forum Discussion

richter_2100's avatar
richter_2100
Regular Visitor
1 year ago
Solved

data for line y-axis combo chart

Hi,

Can someone help me on my powerbi problem, I just need to put a fixed data on the line y-axis of my combo box. 

Data is coming from another table with column name "Benchmark". Per Qid should pull the data benchmark.sample data 

  • Hi richter_2100 ,
    To show a fixed benchmark value as a line on the Y-axis of a combo chart in Power BI, you can create a DAX measure that pulls the benchmark value from a separate table based on the corresponding Qid. This allows you to plot your main metric (e.g., scores or results) as columns and display the benchmark as a line, even though the data comes from different tables. 

     

    For this to work, the measure needs to reference the selected Qid from your main data table and retrieve the matching benchmark from the benchmark table. This approach works even if the tables aren't directly related, as long as the Qid is consistent in both.

     

    Benchmark Line =
    CALCULATE(
        MAX(Benchmark[Benchmark]),
        FILTER(Benchmark, Benchmark[Qid] = SELECTEDVALUE(MainTable[Qid]))
    )
    

7 Replies

  • Hi richter_2100  - Make sure your SurveyResponses or Results table has a QnID column too.

     

    assuming, SurveyResponses[QnID] → BenchmarkTable[QnID]

     

    as per the sample data shared, create a measure for the Benchmark line

    Benchmark Line =
    CALCULATE(
        MAX('QnD'[Benchmark])
    )

     

     

     

     

     

    I hope this helps.

    • richter_2100's avatar
      richter_2100
      Regular Visitor

      did not work unfortunately or did i miss anything?

  • richter_2100's avatar
    richter_2100
    Regular Visitor

    thank you for the responses, this is what I want to do, but no luck 🙂

  • Hi richter_2100 ,
    To show a fixed benchmark value as a line on the Y-axis of a combo chart in Power BI, you can create a DAX measure that pulls the benchmark value from a separate table based on the corresponding Qid. This allows you to plot your main metric (e.g., scores or results) as columns and display the benchmark as a line, even though the data comes from different tables. 

     

    For this to work, the measure needs to reference the selected Qid from your main data table and retrieve the matching benchmark from the benchmark table. This approach works even if the tables aren't directly related, as long as the Qid is consistent in both.

     

    Benchmark Line =
    CALCULATE(
        MAX(Benchmark[Benchmark]),
        FILTER(Benchmark, Benchmark[Qid] = SELECTEDVALUE(MainTable[Qid]))
    )