Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Aggregate percentage column

Hallo Everyone,

 

I am trying to calculate two columns for the Aggregation and value% of total as of the last two columns in the picture. 

The aggregation must be based on the Name, product name ,branch and month dateyear. I have highlighted how each group are. 

I have used the earlier DAX but it seems that I am getting only the grand total of everything. 

 

Could someone help me there? 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Create 2 measures as below:

     

    aggregation = SUMX(FILTER(ALL('Table'),'Table'[Name]=MAX('Table'[Name])&&'Table'[branch]=MAX('Table'[branch])&&'Table'[product name ]=MAX('Table'[product name ])),'Table'[value])
    value% of total = DIVIDE(MAX('Table'[value]),[aggregation])

     

    And you will see:

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please use the below measures:

    Measure 13 = CALCULATE(SUM('Table (4)'[value]),ALL('Table (4)'[Date],'Table (4)'[value]))
    Measure 14 = DIVIDE(SUM('Table (4)'[value]),[Measure 13])

     

    Aiolos Zhao

     

  • Anonymous , Try

     

    Measure = divide(Sum(Table[Value]),sum(Table[Aggregation ]))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous  have you tried my answer?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Create 2 measures as below:

     

    aggregation = SUMX(FILTER(ALL('Table'),'Table'[Name]=MAX('Table'[Name])&&'Table'[branch]=MAX('Table'[branch])&&'Table'[product name ]=MAX('Table'[product name ])),'Table'[value])
    value% of total = DIVIDE(MAX('Table'[value]),[aggregation])

     

    And you will see:

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!