Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a table/matrix using columns from data model as rows based on a condition.

Create a table/matrix using columns from data model as rows and display corresponding values segregated as Total, Quarter 1, Quarter 2, etc.

For example, I have two columns in my dataset - IceCreams Sold, IceCreams Sold to children. I want my visual to show like this :

 

 TotalQ1Q2Q3Q4
IceCreams Sold     
IceCreams Sold to children     

 

Thank you in Advance!

  • TheoC's avatar
    TheoC
    4 years ago

    Hi Anonymous 

     

    If you require the Quarter as the column per your post, then I suggest changing the Quarter from a measure to a calculated column or create a Date table (which would be more aligned to better practice).  You can use this link SQLBI Date Table.

     

    Hope this helps 🙂

    Theo

     

3 Replies

  • TheoC's avatar
    TheoC
    Community Champion

    Hi Anonymous 

     

    Click on Matrix visual.  Add the "Ice Creams Sold" and "IceCreams Sold to Children" in the "Values" section in the visual pane.  Then, add the "Quarter" column in the Columns section of the visual pane.  Go into the Visual's settings as per below and turn on the "Switch Values to Rows" button.

     

    Hope this helps.

    Theo 🙂

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello TheoC ,
      Thank you for the response.

      The Quarter is a measure created in the model. It's not getting added in the Column section of matrix.

      • TheoC's avatar
        TheoC
        Community Champion

        Hi Anonymous 

         

        If you require the Quarter as the column per your post, then I suggest changing the Quarter from a measure to a calculated column or create a Date table (which would be more aligned to better practice).  You can use this link SQLBI Date Table.

         

        Hope this helps 🙂

        Theo