Forum Discussion

GowthamK66's avatar
GowthamK66
Frequent Visitor
1 year ago
Solved

How to create this table(Transpose)

Expectation: all the table measures will be in row-wise below the metrics column, so how we can do this the data source is in the SSMS server
L4 is Last four week, L13,L26,L52 Should come as each column

 

Reality: what we can actually do in power BI is this below

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi GowthamK66 


    Please try this:

    Here I have the sample data:

    You can create a matrix and put the category column on the Columns box:

     

    And open the Switch values in row groups rather that columns:

    The result is as follow:

     

    And here's another workaround:

    Add a new table:

     

     

    Table 2 = {"Measure1","Measure2","Measure3"}

     

     

    Then add a new measure:

     

     

    Measure = 
    VAR _Values = SELECTEDVALUE('Table 2'[Value])
    RETURN 
    SWITCH(
        _Values,
        "Measure1",[Measure1],
        "Measure2",[Measure2],
        "Measure3",[Measure3]
    )

     

     

    Finally, create a matrix with these fields:

    The result is as follow:

     

     

     

    Best Regards

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

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GowthamK66 

     

    Please try this:

    Click the Transform data in the Hoem pane to use the PowerQuery:

    Then in the Transform Pane, you can use the Transpose feature:

    Here I create a set of sample:

    Hold down the Ctrl key and select all the columns and click the Transpose, then click the Use First Row as Headers in the Home pane, the result is as follow:

     

     

    Best Regards

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

     

     

     

  • GowthamK66's avatar
    GowthamK66
    Frequent Visitor

    The thing is all the measures should be placed in the Row level but in Power BI we can't do that, we can place the measure only in Values not in Rows😥

     

  • GowthamK66's avatar
    GowthamK66
    Frequent Visitor

    the screenshot is from power bi Visuals, I do not have a physical table like that

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GowthamK66 


    Please try this:

    Here I have the sample data:

    You can create a matrix and put the category column on the Columns box:

     

    And open the Switch values in row groups rather that columns:

    The result is as follow:

     

    And here's another workaround:

    Add a new table:

     

     

    Table 2 = {"Measure1","Measure2","Measure3"}

     

     

    Then add a new measure:

     

     

    Measure = 
    VAR _Values = SELECTEDVALUE('Table 2'[Value])
    RETURN 
    SWITCH(
        _Values,
        "Measure1",[Measure1],
        "Measure2",[Measure2],
        "Measure3",[Measure3]
    )

     

     

    Finally, create a matrix with these fields:

    The result is as follow:

     

     

     

    Best Regards

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