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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Multiplying rows together only if they meet a particular criteria - Working out M2 using two columns

Hi All,

Pretty new to Power BI. Basicall I am trying to get a M2 summary using CM of Height and Width. The CM are in a Value column along with a heap of other data. I have a Label ID column that runs along this. 

I have a column that holds multiple label IDs that also hold the IDs for Height and Width. The image below shows 1171 and 1170 as Width and Height in the jobtype_fileld_id column along with the Value (which is in cm). 

Capture.JPG

I am trying to make a M2 column first of all. This in Excel would be simply making two new fields with the filtered data then multiplying those two fields together then dividing it by 10000. 


Any help would be awsome.
Many Thanks in Advance

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

use Power Query (Transform data) for this.

Mark the field jobtype_fileld_id and press pivot column.

20191122_pivot.png

 

20191122_pivot_2.png

 

Than calculate your Custom Column

20191122_calculate.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

3 REPLIES 3

Hi @Anonymous ,

 

use Power Query (Transform data) for this.

Mark the field jobtype_fileld_id and press pivot column.

20191122_pivot.png

 

20191122_pivot_2.png

 

Than calculate your Custom Column

20191122_calculate.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Hi @mwegener,

 

Thanks for that. It definitely did the job.


However, as it has split up all the rows it has kept the same number of Job ID Rows. So subsequently I can't just go col A * col B. Do you have a quick solution for grouping these together. I tried the "Group" function. But this made separeate tables rather than removing excess rows or compressing the rows to Job Id.

Many Thanks in advance

Rob

Hi @Anonymous ,

 

reduce first the query to these three columns job_id, jobtype_field_id and value, 

then you should get only one row for each job_id.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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