Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum per group (with PBI example file)

Hi guys,

 

i have a table looking like this and i want to create the Group sum in each row for each article. So basically i want to add the numbers in the red circle as a measure to the table: 

 

You can find the mini example here:

 

https://www.file-upload.net/download-14004880/Example.pbix.html

 

And how can i better attach example files to questions than with a link like that?

 

Thanks!

  • So I would think:

     

    Measure = 
      VAR __Group = MAX('Table'[Article Group])
      VAR __Table = FILTER(ALL('Table'),[Article Group] = __Group)
    RETURN
      SUMX(__Table,[Stock reach days])

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    So I would think:

     

    Measure = 
      VAR __Group = MAX('Table'[Article Group])
      VAR __Table = FILTER(ALL('Table'),[Article Group] = __Group)
    RETURN
      SUMX(__Table,[Stock reach days])