Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Add grouping using DAX

Hi all,

I have columns:

 

Store name

Coleague name

Sales

 

And want to create table that includes only:

 

Colleague name

total sales for Store

 

I don't want to add extra column for Store name and then use allexcept etc.

 

Just want to add grouping/filter using DAX so the result will be as above. It is important to use DAX and not add any extra columns.

 

thanks

 

daniel

  • Hi Anonymous 

    I would use the SUMMARIZE() function to create the table and the SUM() for calculating the sales:

     

    In SUMMARIZE you chose what to group by and then create the measure which we name -> "Sales" and define it by SUM()

     

    Hope this is what youre looking for

6 Replies

  • JohanT's avatar
    JohanT
    Frequent Visitor

    Hi Anonymous 

    I would use the SUMMARIZE() function to create the table and the SUM() for calculating the sales:

     

    In SUMMARIZE you chose what to group by and then create the measure which we name -> "Sales" and define it by SUM()

     

    Hope this is what youre looking for

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      thanks for reply!

      This is close to what i want to achive:

      The result I am looking for is as below:

       

      Jane 30 (total sales for store A - where Jane works)

      Jane 160 (total sales for store B - where Jane works)

      John 30 (total sales for store A - where John works)

      John 160 (total sales for store B - where John works)

      John 10 (as he is the only one employe in store C)

      John 20 (as he is the only one employe in store D)

       

      much appreciated

       

      daniel

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      just managed to do this by linking summarized table (grouped by store) to colleague table (store name to store name).

      Now when you run it by calleague it will pull total store's sales from summarized table.

       

      Much appreciated

       

      daniel

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support
    Hi Anonymous ,

    See if this will meet your requirements
    You can refer to the pbix.
     
    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      I have managed to do this very similar way already. As per my post earlier.

       

      Thanks for reply anyway and have a good day

       

      daniel

      • V-lianl-msft's avatar
        V-lianl-msft
        Community Support
        Hi Anonymous ,
         
        It's glad that you have solved your problem.
        You can share the link and accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
         
        Best Regards,
        Liang
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.