+ Reply to Thread
Results 1 to 5 of 5

DAX Question: Summing a value field for each unique identifier field

  1. #1
    Registered User
    Join Date
    12-21-2018
    Location
    Egypt
    MS-Off Ver
    Office 365 64-bit
    Posts
    20

    DAX Question: Summing a value field for each unique identifier field

    Hi All,

    Hope all is well.

    I'm new to DAX, and I'm trying to write a DAX formula that would sum the "Element Quantity" field, but only for each unique "Element Data" value. Example file is attached.

    Input
    Input.JPG

    Expected Output
    Output.JPG

    Thank You.
    Andrew
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: DAX Question: Summing a value field for each unique identifier field

    Mcode in Power Query

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    12-21-2018
    Location
    Egypt
    MS-Off Ver
    Office 365 64-bit
    Posts
    20

    Re: DAX Question: Summing a value field for each unique identifier field

    Great. Thanks Alan!

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: DAX Question: Summing a value field for each unique identifier field

    Please try Measure

    =SUMX(SUMMARIZE(QueryTable,[SKU],[Element Data],"EQ",AVERAGE([Element Quantity])),[EQ])

    or

    =SUMX(GROUPBY(QueryTable,[SKU],[Element Data],"EQ",AVERAGEX(CURRENTGROUP(),[Element Quantity])),[EQ])
    Attached Files Attached Files
    Last edited by Bo_Ry; 01-18-2022 at 12:54 PM.

  5. #5
    Registered User
    Join Date
    12-21-2018
    Location
    Egypt
    MS-Off Ver
    Office 365 64-bit
    Posts
    20

    Re: DAX Question: Summing a value field for each unique identifier field

    Brilliant. Thank you for this! I'm still learning the iterator functions but that's definitely going to help a lot.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Concatenate cells using a varying identifier in a different field
    By Hermygator in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2020, 04:16 PM
  2. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  3. [SOLVED] PowerPivot: Merge Month Field and Year Field Into a Date Field
    By mo4391 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-17-2015, 11:59 AM
  4. Creating unique identifier field using Countifs
    By palmam in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-06-2015, 07:18 PM
  5. Replies: 2
    Last Post: 03-23-2014, 08:11 PM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. Replies: 3
    Last Post: 03-03-2012, 12:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1