Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Is it possible to have Pivot Table with nested with multiple facts for the row?

Hi there,

 

Hope everyone enjoyed there weekend.  Quick question for you all.  Perhaps I missing the visualization and/or flag, but is it possible to have a pivot table where key data facts are nested on the initial column with additional columns listed for other data facts?  

 

I know there a flag called Stepped Layout that lets you make the rows "nested" where they all show under one column.  You can also turn this off and as you drill deeper in rows additional columns appear.  However, I want the nested to be there for certain key values, but would just like the rest of the table to show up as seperate columns.  To better explain this I drew a picture...  In the example below, I'd like to know how to make Email / Phone appear while Employee is under Department in the same column...

 

As always, any help is much appreciated!  Thank you all!  

 

  • Hi Anonymous ,

     

    This option of having some columns in the step layout and other not is not possible. Believe that this is a look and feel problem correct?

    One option can be to add the E-mail and Phone to the values part of the table, however you would need to do the following:

     

    Create a table with the names of the values you need adding the E-mail and phone something similar to:

    MeasureSelection =
    SWITCH (
        TRUE ();
        SELECTEDVALUE ( 'Table'[Measure] ) = "Email"; IF ( HASONEVALUE ( Table[Name] ); MAX ( Table[Email] ); BLANK () );
        SELECTEDVALUE ( 'Table'[Measure] ) = "Phone"; IF ( HASONEVALUE ( Table[Name] ); MAX ( Table[Phone] ); BLANK () );
        SELECTEDVALUE ( 'Table'[Measure] ) = "ValueA"; SUM ( Table[ValueA] );
        SELECTEDVALUE ( 'Table'[Measure] ) = "ValueB"; SUM ( Table[ValueB] )
    )

    Now just use the measure column on the column headers and the measureselection on values.

3 Replies

  • Hi Anonymous ,

     

    This option of having some columns in the step layout and other not is not possible. Believe that this is a look and feel problem correct?

    One option can be to add the E-mail and Phone to the values part of the table, however you would need to do the following:

     

    Create a table with the names of the values you need adding the E-mail and phone something similar to:

    MeasureSelection =
    SWITCH (
        TRUE ();
        SELECTEDVALUE ( 'Table'[Measure] ) = "Email"; IF ( HASONEVALUE ( Table[Name] ); MAX ( Table[Email] ); BLANK () );
        SELECTEDVALUE ( 'Table'[Measure] ) = "Phone"; IF ( HASONEVALUE ( Table[Name] ); MAX ( Table[Phone] ); BLANK () );
        SELECTEDVALUE ( 'Table'[Measure] ) = "ValueA"; SUM ( Table[ValueA] );
        SELECTEDVALUE ( 'Table'[Measure] ) = "ValueB"; SUM ( Table[ValueB] )
    )

    Now just use the measure column on the column headers and the measureselection on values.

    • Anonymous's avatar
      Anonymous
      Not applicable

      MFelix Thanks Miguel!  I actually just came on hear to let others know of a way I had figured out earlier today (honestly by mistake).  It was similar to your approach of using it as a value (although I just used the max without the if statement).  However, it wasn't perfect because it repeated with each column total.  Nevertheless, I'll give your version a try tomorrow to see if that makes it a bit cleaner.

       

      amitchandak, definitely just voted.  Really shocked this isn't a basic feature of the product.

       

      -Brett