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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Krzysztof_Hyla
Helper II
Helper II

Mulitply columns from 2 related tables

Hi, I'm trying to build a measure (called 'Earned Hours') that multiplies 2 columns from related tables - quantities and standard hours per product.

 

My data model looks like this:

 

Data Model.jpg

 

My current measure calculates correct results per row, but does not give me correct total: 

Earned Hours = SUM('Fact Production'[Quantity])*SUM('Fact Std Hrs'[Std Hrs])

 

Output.jpg

The correct number should be:

Output 2.jpg

I have simplified my original post to make this easier to understand.

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Krzysztof_Hyla try below measure to get correct total

Measure = 
VAR _product = SUM(factProduction[Quantity])*SUM(factStdHours[StdHours])
VAR _summarize = SUMMARIZE(dimProduct,dimProduct[Product],"total",SUM(factProduction[Quantity])*SUM(factStdHours[StdHours]))
RETURN IF(HASONEVALUE(dimProduct[Product]),_product,SUMX(_summarize,[total]))

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Krzysztof_Hyla try below measure to get correct total

Measure = 
VAR _product = SUM(factProduction[Quantity])*SUM(factStdHours[StdHours])
VAR _summarize = SUMMARIZE(dimProduct,dimProduct[Product],"total",SUM(factProduction[Quantity])*SUM(factStdHours[StdHours]))
RETURN IF(HASONEVALUE(dimProduct[Product]),_product,SUMX(_summarize,[total]))

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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