Multiplying Two Columns in Power BI

  • Multiplying Two Columns in Power BI

    Posted by DSC Communities on February 1, 2023 at 1:21 am

    Multiplying Two Columns in Power BIFollow
    Bob McMullen
    Bob McMullenFeb 01, 2023 02:52 PM
    I am trying to multiply two different columns in the same table in BI. I have tried a measure and …
    1. Multiplying Two Columns in Power BI

    Bronze Contributor
    Bob McMullen
    Posted Feb 01, 2023 02:52 PM
    I am trying to multiply two different columns in the same table in BI.

    I have tried a measure and a calculated column to create a cost sorting factor, and both of them are incorrect.

    Measure: Sorting Factor = SUMX(‘AWD-RbA Append’,’AWD-RbA Append'[Adjusted Cost] * ‘AWD-RbA Append'[Occurrences Total])

    Column: Sort = ‘AWD-RbA Append'[Occurrences Total]*’AWD-RbA Append'[Adjusted Cost]

    They both return the same value, but neither is correct.

    Any ideas?

    Thanks!

    image

     

    ——————————
    Bob McMullen
    Project Manager
    Bayport MN
    6512642569
    ——————————

    2. RE: Multiplying Two Columns in Power BI

    Bronze Contributor
    James Watts
    Posted Feb 02, 2023 06:53 AM
    Is the number you [sum of cost] * [sum of occurrences] ? What you have been calculating is the sum of [cost] * [occurrences].

    If you a product with two rows in the database:

    Occurrences Cost Occur * Cost
    1 5 5
    3 1 3
    Is what you want to see (3+1) * (5+1), which is 24 ?

     

    ——————————
    James Watts
    Business Intelligence Analyst
    ——————————

     

    3. RE: Multiplying Two Columns in Power BI

    Bronze Contributor
    Bob McMullen
    Posted Feb 02, 2023 04:56 PM
    James,

    Thanks for your reply!

    I got the script fixed. I was close, but not quite right. The correct script is:

    = sum(‘AWD-RbA Append'[Occurrences Total]) * sum(‘AWD-RbA Append'[Adjusted Cost])

    Thanks!

    Bob McMullen.

     

     

    replied 2 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Multiplying Two Columns in Power BI’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!