Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

total value for each category

Hi All,

 

my dax doesn't go as expected when i dorill up.

 

dax =
DIVIDE(
sum(table1[Value1])
, sum(table2[Value2])
)

 

 

  • Hi Anonymous ,

     

    Please try the following formula:

     

    Measure = 
    SUMX ( 
        SUMMARIZE ( 
            Table1, 
            dim1[name], 
            dim2[name], 
            "SubValue", [dax] 
        ),
        [SubValue]
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

9 Replies

  • Anonymous , seem like you need some of Avg

     

    Sumx(summarize(Table, Table[Category], Table[Sub Category], "_1", dax =
    DIVIDE(
    sum(table1[Value1])
    , sum(table2[Value2])
    ) ), [_1])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the help !!

       

      But your dax is not work.

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Anonymous , If this does not help
        Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Please try the following formula:

     

    Measure = 
    SUMX ( 
        SUMMARIZE ( 
            Table1, 
            dim1[name], 
            dim2[name], 
            "SubValue", [dax] 
        ),
        [SubValue]
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.