Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Aggregate Data with multiple records

Hi all,

 

I have produced this table below to help describe what I need help with. But I need to aggregate this data so when I look for the month of November 2019 for the type 201, I need the value of 1.8 (1+0.8 = 1.8 and using "Card" in dashboard) but instead I get the figure of 2.6 (1+0.8+0.8), how do I aggregate when the ID is the same but it's the value I need by the type.

 

I also need to look at past dates values too, so for Sep - 19 for 201 type the value should be1.5.

 

IDValueAmountTypeDates

123

14201Aug-19
12315201Sep-19
12316205Sep19
12317201Oct-19
1230.88201Nov-19
1230.82201Nov-19
1240.54201Aug-19
1240.56201Sep-19
12412205

Sep-19

12415201

Oct-19

12413201

Nov-19

 

Any suggestions would be very helpful.

  • Anonymous ,

     

    Create a measure using dax below:

    Result = CALCULATE(SUMX(DISTINCT('Table'[Value]), 'Table'[Value]), ALLSELECTED('Table'))

     

     

    You can also refer to the pbix file.

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

4 Replies

  • Anonymous try this measure

     

    Measure = 
    SUMX ( 
        SUMMARIZE ( 'Table', 'Table'[Type], 'Table'[Value] ), 
        CALCULATE( MAX('Table'[Value] ) ) 
    )

     

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Anonymous ,

     

    Create a measure using dax below:

    Result = CALCULATE(SUMX(DISTINCT('Table'[Value]), 'Table'[Value]), ALLSELECTED('Table'))

     

     

    You can also refer to the pbix file.

     

    Community Support Team _ Jimmy Tao

    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, thank you for replying but unfortunately this didn't work for me and gave me a smaller number then it shoud be.

       

      I need it unique to the individual and sum their value for the month selected.

      • parry2k's avatar
        parry2k
        Super User

        Anonymous can you put data in sample excel file and explain what you want. It is not sure which solution you tried and what is not working, you have to provide more details for further help.