Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

How to calculate two columns based on Excel formula?

Hi guys,

 

I am a PowerBI noob and i would like to have your help. I  have a table that with different price group called Group A

Each row on Group A has a different price which are inserted in column price group A. 

 

I need to create a table in PowerBI for calculating the column Total. the excel formula ot the Total is price group A  multiply column C.

 

Any suggestions to make this happens in PowerBI? do i need to make a calculated column or a measure? any examples would be grateful.

 

Many thanks!

 

Rega

 

 

 

 

 

 

 

  • Hi Anonymous,

     

    Try this calculated field formula

     

    =if(HASONEVALUE(DFMORDERTEMPLATES[AMOUNT]),min(DFMORDERTEMPLATES[AMOUNT])*[TOTAALBETALENDLEDEN],SUMX(SUMMARIZE(DFMORDERTEMPLATES,DFMORDERTEMPLATES[AMOUNT],"ABCD",min(DFMORDERTEMPLATES[AMOUNT])*[TOTAALBETALENDLEDEN]),[ABCD]))

    Hope this helps.

14 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous,

     

    If [price group A] is a column, and [C] is a measure, you only need to create a measure like below to calculate the multiply value.

    Total = SUM(Table1[Price Group A])*[C]

     

    To help us better understand your scenario, please provide detailed data in source table and show us all necessary formulas you have used in this report.

     

    Regards,
    Yuliana Gu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-yulgu-msft,

       

      Thanks for your reaction. how can i share my pbix files to you?

      • v-yulgu-msft's avatar
        v-yulgu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi Anonymous,

         

        You can upload your pbix file on onedrive and attach the shared link here.

         

        Regards,
        Yuliana Gu

  • Omega's avatar
    Omega
    Icon for Impactful Individual rankImpactful Individual

    Create a measure called Total: 

     

    Total = SUM(Table1[Price Group A])*SUM(Table1[C]) 

     

    Create a table and drag all the columns including total. 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Omega

       

      Thanks for your reply.

       

      unfortunatly Your formula doesnt calculated the Total.

       

      Would you please check the pbix file ?

       

      Thanks.

       

       

       

       

      • Omega's avatar
        Omega
        Icon for Impactful Individual rankImpactful Individual

        Anonymous

         

        Can you please elaborate further? Isn't Total= Price Group A*C.