Forum Discussion

Ruedi007's avatar
Ruedi007
Frequent Visitor
6 years ago
Solved

Multidynamic (x- and y-Axis) Regression

Hello!


I try to accomplish the following thing.


I have a dataset with variables v1,v2,....,vn


I try to greate a regession plot where I have two filters one for the x and one for the y axis with wich I can choose the variables to plot.


Filter1: v1,v2,...,vn

Filter2: v1,v2,...,vn


If I select v3 in Filter 1 and v5 in Filter 2 then I see the regression plot of these two variables.


What I have tried is to create an index and unpivot the variabels so I get Attribute, Index and Value (see Solution) and to put Attribute into x-Axis and y-Axis but I get the message that this cannot be displayed.


Could anyone lend me a hend to accomplish this or a tutorial would be great as well.


Best!

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Ruedi007 

    I build a table to have a test.

    After transforming, rename Table as X axis. You need to duplicate the X axis table and rename the new one as Y axis.

    Build relationship between Index column in two tables.

    Build a Scatter chart or line chart to see the result.

    You can download the pbix file from this link:  Multidynamic (x- and y-Axis) Regression

     

    Best Regards,

    Rico Zhou

     

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

3 Replies

  • Hi Ruedi007 ,

     

    What you need to do in this case (and be aware that there is not much information to get on by) is to create two disconnected tables with the V1, V2,... ,VN.

     

    Then you mus create your values to be filtered out on the selection of the slicer:

     

    Measure =
    VAR X_Value =
        SELECTEDVALUE ( TableX[Column] )
    VAR Y_Value =
        SELECTEDVALUE ( TableY[Column] )
    RETURN
        DIVIDE (
            CALCULATE ( SUM ( Table[Column] ), FILTER ( Table, Table[Column] = X_Value ) ),
            CALCULATE ( SUM ( Table[Column] ), FILTER ( Table, Table[Column] = Y_Value ) )
        )

    Be aware that this measure does not make the regression, and that this is only a very simplified way to get information the values need to be adjusted.

     

    Regarding a regreession you can see this post

    https://community.powerbi.com/t5/Desktop/Simple-Linear-Regression-with-DAX/m-p/9272#M1736

     

    Also please see this post regarding How to Get Your Question Answered Quickly (courtesy of @Greg_Deckler) and How to provide sample data in the Power BI Forum (courtesy of @ImkeF).

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ruedi007 

    I build a table to have a test.

    After transforming, rename Table as X axis. You need to duplicate the X axis table and rename the new one as Y axis.

    Build relationship between Index column in two tables.

    Build a Scatter chart or line chart to see the result.

    You can download the pbix file from this link:  Multidynamic (x- and y-Axis) Regression

     

    Best Regards,

    Rico Zhou

     

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ruedi007 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Best Regards,

    Rico Zhou