Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
agupta2481
Regular Visitor

Multiply every entry in column in one query with a fixed number from another query

Multiply every entry in column in one query with a fixed number from another querytwo query multiplication problem.png

 

 

Hi, 

one have one query where in there are five rows and five columns. Rows are for names of sales person and columns are for the "Part number" of the product being sold as shown in the above image . Each row carries the name of the sales person and each column carries the units sold by each sales person.

 

Then there is another query  and in this query there is only three columns, 1st Columns has the heading as "Product",, 2nd Column has the heading "Product Name" and the 3rd columns has the cost Price. 

 

How can i get the cost price multiplied with all the units sold in single column. the Cost Price is variable and will change on monthy basis.

 

this is a small data figure from large data set. 

3 REPLIES 3
agupta2481
Regular Visitor

Hi Ashish,

 

Thanks for the quick Response. 

 

Please Downlaod the files from the link https://we.tl/t-7XrHE8V5iV

 

3rd Worksheet contains the desired result from earlier two work sheets.

Hi,

Select the first 2 columns of Query 1, right click and select "Unpivot Other Columns".  Rename the Attribute column to Product Code and Value column to Quantity.  Append Query 1 and Query 2 into a third Query.  Remove all columns other than the Product Code column.  Change case of that single column to Upper case and Remove duplicates.  In Query 1, enter this calculated column formula

Cost = lookupvalue('Query 2'[Actual Cost],'Query 2'[Product Code],'Query 1'[Product Code])

Amount = 'Query 1'[Cost]*'Query 1'[Quantity]

Write this measure and drag it to your visual

Total = sum('Query 1'[Amount])


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

The images are ust way too small.  Cannot understand a thing there.  Put that information in an MS Excel file and share the download link of that file.  Explain your requirement via comments boxes in that Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors