Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Using a table visual, splitting the results into 2 columns

Hello,

 

I have a table with a single column, but I want the results to be split among two columns instead.

What I have, with just a single column.            The layout I want from the table.

I understand I might need to use a DAX query for this, but how can it be done?

 

Thank you!

9 Replies

  • Hi Anonymous ,

     

     

    what is the logic for splitting into 2 columns?

    You simply want the bottom half of rows to be in the 2nd column? or something different

     

    LC

    Interested in Power BI and DAX templates? Check out my blog at www.finance-bi.com

    • Anonymous's avatar
      Anonymous
      Not applicable

      That is correct. Either taking the bottom half results and printing them to a second column, or just alternating printing between to columns.

      • lc_finance's avatar
        lc_finance
        Solution Sage

        Hi Anonymous ,

         

        You can download my proposed solution from here.

         

        Here are the steps:

        1) add an Index column in Power Query

        2) Go back to Power BI and add a calculated column. Here is DAX the formula for it:

        Column number = 
        VAR numberOfRows = COUNTROWS('Text')
        RETURN IF ([Index]<=numberOfRows/2 , 1,2)

        This calculated column returns 1 for the first half of the rows (to be included in column 1) and 2 for the second half of the rows (to be included in column 2).

         

        3) Add 2 tables to your report. Filter the first table for column number =1 and the second table for column number=2.

         

        That's it!

        Does this help you?

         

        LC

        Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com