Forum Discussion

exo's avatar
exo
Frequent Visitor
3 years ago

Return sum value based on category

Hi all.

I have the following simplified dataset:


As the picture shows, I want to return the values based on the category.
The Cc type 2 cells don't have direct volume, but in the calculation I need to return the following values for them:

1. The yellow highlighted dataset has direct volume, this should be returned in the final column.

2. The green highlighted cells should return Sub category Z's volume.

3. The blue highlighted cells should return the total volume.

5 Replies

  • Hi exo,

     

    In the dataset, I would create a field called "Category", which has the row contents of the "Amount" column in your 2nd table, and the when you import that 1st table with the additional "Category" field, create a calculated column with the following dax expression as shown in the screen print below:

     

    That would produce the same output as the "Amount" column in your 2nd table.  The important thing is to create a field in the table because color differentiation in the dataset table cannot be properly processed.  

     

    • exo's avatar
      exo
      Frequent Visitor

      Hi Sakiko,

       

      thanks for your reply. However this solution you mentioned is not the one I'm looking for. This is mainly due to a misunderstanding of my question.

       

      The amount column is only for explanation. The Direct in the amount column is already represented in the CC type ("1" value), z is also in the subcategory table, and the total is only for the summed volume amounts. So I do have these values, but these are all in different columns.

      Do you have a suggestion based on the above mentioned details?

       

      Thank you for answer in advance!

       

      • DataNinja777's avatar
        DataNinja777
        Super User

        Hi exo

        Does CC type stand for Cost center type?  I'd greatly appreciate it if you could tell me what you'd like to achive.