Forum Discussion

Satish_Kumar's avatar
Satish_Kumar
Helper V
9 years ago
Solved

How to use group's in data

Help me in using Summerize command in DAX.

 

i am new at power bi.

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Satish_Kumar,

     

    Please try below code if it works on your side.

     

    Sample:

     

    Tables.

     

    Formula:

     

    Summary Table = ADDCOLUMNS(SUMMARIZE(Sheet1,Sheet1[Document No_],Sheet1[Buy-from Vendor No_],"Sum of No",SUMX(FILTER(ALL(Sheet1),Sheet1[Document No_]=EARLIER(Sheet1[Document No_])),Sheet1[Amount Including Tax])),"Posting Date",LOOKUPVALUE(Sheet2[Posting Date],Sheet2[No_],Sheet1[Document No_]),"Posting Description",LOOKUPVALUE(Sheet2[Posting Description],Sheet2[No_],Sheet1[Document No_]))

     

     

    Regards,

    Xiaoxin Sheng

15 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    Satish_Kumar In power bi desktop go to query editor (Edit Queries) and under Transform tab use Group By. May be easier to do it this way.

     

      • Satish_Kumar's avatar
        Satish_Kumar
        Helper V

        And if you share your knowledge to join two table and convert into one comman table.

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Satish_Kumar,

     

    First of all, Summarize function is used to summary columns and return a result table. So you can't use it at calculate column. You need to use calculate table to receive the result of the function.

     

    For example:

     

    Base table.

     

    I want to summary above table and get the count of product and sum of amount, formula:

     

    Summary Table = SUMMARIZE(Sheet1,[Product],"Count",COUNTA(Sheet1[Product]),"Sum",SUM(Sheet1[Amout]))

     

     

    In addition, you can directly use visual to get the summary result:
    Table visual:

     

    Matrix visual:

     

    Reference:

    SUMMARIZE Function (DAX)

    Returns a summary table for the requested totals over a set of groups.

     

    Regards,

    Xiaoxin Sheng

    • Satish_Kumar's avatar
      Satish_Kumar
      Helper V

      HI TO ALL ...

      THANXX FOR HELP...

      BUT I AM ASKING FOR GROUPING AND JOINNING OF TWO TABLE TO MAKE A COMMAN TABLE...

      GROUPING OF TABLE IS DONE SO PLEASE HELP ME IN JOIN ASAP.

    • Satish_Kumar's avatar
      Satish_Kumar
      Helper V

      HI TO ALL ...

      THANXX FOR HELP...

      BUT I AM ASKING FOR GROUPING AND JOINNING OF TWO TABLE TO MAKE A COMMAN TABLE...

      GROUPING OF TABLE IS DONE SO PLEASE HELP ME IN JOIN ASAP.