Forum Discussion

xariet's avatar
xariet
Helper I
3 years ago
Solved

Dynamic constant line for scatter plot based on parameter values

Is it feasible to create a dynamic constant line based on the values of a field parameter? Suppose I have a scatter plot with Annual Income on the x-axis and a Field parameter called "Pick measure" o...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , xariet 

    According to your description, you want to add a constant line in your visual and you get an error code .

    I test it in my side , when using your dax code , i get the same error in my side .

    For this , it seems we can not use the SELECTEDVALUE() function to get the slicers' selection.

    You can try to use this dax code and we can meet your need:

    choose Value = IF(
         MAX('Choose measure 2'[Pick measure])="LTV ratio",
        40,
        IF(
            MAX('Choose measure 2'[Pick measure])="Borrower Debt to Income Ratio",
            80,
            IF(
                MAX('Choose measure 2'[Pick measure])="Amount Borrowed",
                150000,
                0
            )
        )
    )
    

     

     

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly