Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Total with many condition

Hi,

Here's my table:

 

How can I calculate the volume of a RUN (or many RUN) by choosing a length who was produce in this (or these) RUN?

e.g. length 8. Only in the RUN M241 for a total volume of 4,3.

e.g. lengtt 11,5. In Run M241 and M242 for a total volume of 12,3.

 

How can I calculate the volume of a RUN (or many RUN) by choosing a User_ID who works in this (or these) RUN?

e.g. User_ID 6 works in RUN M241 and M242 = 12,3.

e.g. User_ID 11 works in RUN M242 = 8.

*This measure works: CALCULATE(SUMX(table;table[VOLUME]);all(table[LENGTH))

 

How can I calculate the volume of a RUN (or many RUN) by choosing a User_ID who works and a length who was produce in this (or these) RUN?
e.g. length 11,5 and User_ID 6 =  Volume of 2,3.

e.g. length 8 and User_ID 4 =  Volume of 5,7.

 

I hope I gave enough information to receive your help.

Thanks

  • Anonymous's avatar
    Anonymous
    6 years ago

    I succeeded to have the expecting result. In another table I have the Run so I made this measure and it works:

    CALCULATE(CALCULATE(SUMX(table;table[Volume]);ALL(table[Length]);RELATEDTABLE(RUN))

    Thanks for your support.

5 Replies

  • Hi Anonymous ,

     

     

    You can download my proposed solution from here.

    Based on your description, I think Power BI slicer should do the job and we don't need to add specific formulas.

     

    Below is a screenshot based on your third example:

     

    Does this help you?

     

    LC

    Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks lc_finance ,

      But the expected result with these slicer should be the total of volume of all the RUN where the length 11,5 was produce. Same things for User_ID. In that case the total volume is for RUN M241 is 4,3 and for RUN M242 it's 8.

      Thanks for your time.

      • lc_finance's avatar
        lc_finance
        Icon for Solution Sage rankSolution Sage

        Hi Anonymous 

         

         

        thank you, I understand better the question now.

        You can do that using ALL. You can download my updated solution from here.

         

        You can add a measure with the following formula:

        Unfiltered volume = CALCULATE(SUM('Run Table'[VOLUME]), ALLEXCEPT('Run Table','Run Table'[RUN]))

         

        This is a screenshot of the solution:

         

         

        Let me know if this is what you are looking for.

         

        LC

        Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com