Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Ttable data consolidate

Hi All,

Have table as mentioned below with Multiple names and Grades.

NameGradeCost
AppleA120
AppleB90
AppleA120
AppleB90
AppleC80
AppleD75
AppleC80

Required to consolidate the above table as per the below table.

NameGradeCost
AppleA240
AppleB180
AppleC180
AppleD75

 

Any one can help me!!!

Thanks in advance.

 

Regards,

Murali

  • Hi Anonymous ,

     

    Solution1:

     

    You can just put the column Name, Grade, Cost into Table visual, then set the aggregation of cost as "Sum".

     

     

     

     

     

     

     

     

     

     

     

     

    Solution2:

     

    You can create measure like DAX below.

     

    Measure1= CALCULATE(SUM(Table1[Cost]),FILTER(ALLSELECTED(Table1),Table1[Name] =MAX(Table1[Name])&&Table1[Grade] =MAX(Table1[Grade])))

     

    Best Regards,

    Amy

     

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

     

     

3 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi Anonymous ,

     

    Try =sumx(values('Table1 2'[Grade]),'Table1 2'[Sum of Cost]).

     

    or in PBI

    Consolidate = sumx(values('Table1_2'[Grade]),SUM(Table1_2[Cost]))

     

     

     

    If this helps, consider marking this as the solution! Kudos are nice too.

     

    Nathaniel

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Anonymous ,

     

    Solution1:

     

    You can just put the column Name, Grade, Cost into Table visual, then set the aggregation of cost as "Sum".

     

     

     

     

     

     

     

     

     

     

     

     

    Solution2:

     

    You can create measure like DAX below.

     

    Measure1= CALCULATE(SUM(Table1[Cost]),FILTER(ALLSELECTED(Table1),Table1[Name] =MAX(Table1[Name])&&Table1[Grade] =MAX(Table1[Grade])))

     

    Best Regards,

    Amy

     

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

     

     

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi  Anonymous ,

     

    Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

     

    Best regards

    Amy