Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filter -Help!

Hi! What am I doing wrong?

I am calculating a table cell from the sum of a column in Table 1. I need the sum only if a second column in Table 1 meets my criteria. 

 

 
  • Hi Anonymous,

     

    To new measure:

     

    Oil MMBBLS =
    VAR sumall =
        CALCULATE ( SUM ( Table1[Column2] ), ALL ( Table1 ) )
    VAR c1 =
        MAX ( Table1[Column1] )
    RETURN
        IF ( c1 = "Proved Developed Non- Producing", sumall, BLANK () )
    

     

    For more details, please check the pbix as attached. If it doesn't meet your requirement, kindly share your excepted result to me.

     

    Regards,

    Frank

9 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish_Mathur -

      I am new to this and it is for a project. Your help means SO MUCH!!!

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

         

        Try this calculated column formula

         

        =IF('1P Reserves'[Column1]="Proved Developed Producing",CALCULATE(SUM('Reserve Run'[OilNet(Mbbl)]),'Reserve Run'[Reserve Category]="Producing"))

         

        Hope this helps.

         

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Anonymous,

     

    To new measure:

     

    Oil MMBBLS =
    VAR sumall =
        CALCULATE ( SUM ( Table1[Column2] ), ALL ( Table1 ) )
    VAR c1 =
        MAX ( Table1[Column1] )
    RETURN
        IF ( c1 = "Proved Developed Non- Producing", sumall, BLANK () )
    

     

    For more details, please check the pbix as attached. If it doesn't meet your requirement, kindly share your excepted result to me.

     

    Regards,

    Frank

    • v-frfei-msft's avatar
      v-frfei-msft
      Community Support

      Hi Anonymous,

       

      Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

       

      Regards,
      Frank