Forum Discussion

Uzi2019's avatar
Uzi2019
Community Champion
3 years ago
Solved

Divide Row value with Sub Total

Hello Expert,
I need your help in getting the row subtotal value. I have given the example:

 

 


I am not able to get the sub total value through meaure. beacuse i need to divide row value with sub total value like(600,180,50,20).
Please help me to get the sub total value.

Thank you in advance

 

  • Uzi2019 Try this DAX Measure:
    Measure = 

    VAR _Curr = SUM(Table[Spends])
    VAR _All = CALCULATE(_Curr,REMOVEFILTERS(Table[Product]))
    RETURN DIVIDE(_Curr,_All,0)
     

6 Replies

  • Uzi2019 Try this DAX Measure:
    Measure = 

    VAR _Curr = SUM(Table[Spends])
    VAR _All = CALCULATE(_Curr,REMOVEFILTERS(Table[Product]))
    RETURN DIVIDE(_Curr,_All,0)
     
  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Uzi2019 

     

    You can try the following methods.
    Sample data:

    Measure = 
    Var _N1=SUM('Table'[Value])
    Var _N2= CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Region],'Table'[Category]))
    Return
    DIVIDE(_N1,_N2)

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

    • Uzi2019's avatar
      Uzi2019
      Community Champion

      v-zhangti  Thanks for your reply. I tried this already but I have few slicers of Year,Month, etc. when we select any value from slicer so measure values remain constant. I used ALLSELECTED as well but measure value is not changing as per slicer value selected.

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

        Hi, Uzi2019 

         

        Please provide sample data and expected output. Sensitive information can be removed in advance.

         

        Best Regards