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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
alesmarcioni
Frequent Visitor

Need Help - Measure (Basic)

Hi everybody, I'm Alessandro, a new user in this forum. It is really nice to meet you!

I started using Power B.I. just this week and, !wow!, it is a really great tool!

I need a (i think basic) help for create a new measure because i don't understand how to make a simple multiplication. 

I've got 2 tables (which have a join on ItemID).

 

TABLE A: ItemID, cost

TABLE B: SerialNumber(univ.), ItemID, Qty

 

For every SerialNumber i have to make (TABLE A).cost * (TABLE B).Qty

In SQL it is an easy operation, but i can't get this in Power BI.

Can anyone explain me any step to make this measure?

 

Thank you so mutch for the help!

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi Alessandro,

 

Welcome to the forum 🙂

 

In this situation, you can use SUMX to iterate over the rows of 'TABLE A' and multiply each row's cost by the sum of Qty for the corresponding rows in 'TABLE B'.

In fact you can iterate over the distinct values of 'TABLE A'[cost] rather than each row of 'TABLE A':

 

=
SUMX (
    VALUES ( 'TABLE A'[cost] ),
    'TABLE A'[cost] * CALCULATE ( SUM ( 'TABLE B'[Qty] ) )
)

Does a measure like this give you the result you expect?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi Alessandro,

 

Welcome to the forum 🙂

 

In this situation, you can use SUMX to iterate over the rows of 'TABLE A' and multiply each row's cost by the sum of Qty for the corresponding rows in 'TABLE B'.

In fact you can iterate over the distinct values of 'TABLE A'[cost] rather than each row of 'TABLE A':

 

=
SUMX (
    VALUES ( 'TABLE A'[cost] ),
    'TABLE A'[cost] * CALCULATE ( SUM ( 'TABLE B'[Qty] ) )
)

Does a measure like this give you the result you expect?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Owen, the result is exactly what i expected.  Smiley Very Happy

Great, and thankyou so mutch! 

Hope I'll become more skilled in this sense Smiley Wink

Thank you again!

 

Alessandro M.

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.