Forum Discussion

OskariNi's avatar
OskariNi
Helper I
8 years ago

Create column filled with measures

I have multiple measures (six in total, representing quarters of a year Q1,Q2,etc) that are counts from a column. I would like to create a new column with these six values and add the the column to an existing table of 6 rows x n columns. Is this possible?

 

Later I will get more measures from recent Quarter Q1 of 2018 and I would like to add this information as a new row to the table. I would appreciate advice for this problem too. 

 

Thanks, 

Oskari

8 Replies

  • prateekraina's avatar
    prateekraina
    Memorable Member

    Hi OskariNi,

     

    You cannot add measures in a column.

    You can drag these measures in a table or matrix along with your other columns to get the result.

     

    If you desire to achieve calculation at row level, then you should create Calculated Columns instead of measures.

    It woule be better if you post some sample data and explain what your output should be like, then we will be able to help you precisely.

     

    Prateek Raina

    • OskariNi's avatar
      OskariNi
      Helper I

      Here is a excel version of the table I want to generate in power BI. The markerd values are these measures I calculated from a larger dataset using COUNTA and FILTER in the following way

       

      Q12015 delay over 2h = CALCULATE(COUNTA(Test[Delay]);FILTER(ALL(Test[Delay]);Test[Delay]>0,08333335);FILTER(ALL(Test[Date].[Year]);Test[Date].[Year]=2015);FILTER(ALL(Test[Date].[MonthNo]);Test[Date].[MonthNo]<7))

       

      Now that I have these measures I would like to generate a table as in the picture and add the measures as columns circled with blue, I don't know if the Calculated Columns work because I need to put a different DAX function for each row (because the Quarter changes)

      • prateekraina's avatar
        prateekraina
        Memorable Member

        Hi OskariNi,

         

        Here is how you can do it in Power BI:

         

        1. Pull in your columns required for the measure calculation and other columns if you need to showcase them in the table.

        2. When the data is loaded in Power BI, right click on your table and Create Measure. Use the same DAX to create your 3 measures which you used in Excel.

        3. When all the measures are created, Drag a table visual on the canvas.

        4. Drag all the 5 columns which you showcased in the screenshot.

        5. Now start dragging your 3 measures, you will see the exact same table as it was in Excel.

         

        Let me know if you face any issues.

         

        Prateek Raina