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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RookiePBI2019
Regular Visitor

Multiply measure by a factor

 

Dear all,

 

I am completely blocked, I would need to multiply a measure calculated by a conditional factor, I mean, I have created a formula to receive an average between 2 years depending the order type and now I have to multiply that measure by a factor conditioning the order type.

 

Order TypeYearQty
A20193
A20184
B20195
B20182
C20196
C201832

 

Order TypeFactor
A0,33
B1,05
C1,15

 

could someone please help me?

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @RookiePBI2019 ,

 

To create a measure as below.

Measure =
VAR averag =
    AVERAGE ( 'Table'[Qty] )
VAR ty =
    MAX ( 'Table'[Order Type] )
VAR fact =
    CALCULATE ( MAX ( Factor[Factor] ), FILTER ( Factor, Factor[Order Type] = ty ) )
RETURN
    averag * fact

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Build a relationship from the Order Type column of Table1 to the Order Type column of Table2.  In Table1, write this calculated column formula

=RELATED(Table2[Factor])

To your visual, drag Order Type from Table2.  You may now create this measure

=SUMX(Table1,Table1[Factor]*Table1[Qty])

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

Hi @RookiePBI2019 ,

 

To create a measure as below.

Measure =
VAR averag =
    AVERAGE ( 'Table'[Qty] )
VAR ty =
    MAX ( 'Table'[Order Type] )
VAR fact =
    CALCULATE ( MAX ( Factor[Factor] ), FILTER ( Factor, Factor[Order Type] = ty ) )
RETURN
    averag * fact

Capture.PNG

 

For more details, please check the pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
rsaprano
Most Valuable Professional
Most Valuable Professional

Hi @RookiePBI2019 

 

There are multiple ways to do this though I think the neatest is to use a separate order types (dimension) table that contains the factors and relate it to the measure with the order quantities as so:

 

related factor data model.png

 

You can then multiply your measure by the corresponding row in the factors table by using SUMX e.g.

 

Factored Quantity SUMX =
[Average Qty Per Year By Type] * SUMX(OrderTypeFactors,OrderTypeFactors[Factor])

 

Note that if you want to make sure that the measure is only shown against a specified order type (with no total), you could write a measure that picks out the relevant factor e.g:

 

Factored Quantity =
VAR OneOrderTypeSelected = HASONEVALUE(OrderTypeFactors[Order Type])
VAR SelectedOrderType = SELECTEDVALUE(OrderTypeFactors[Order Type])
VAR Factor = CALCULATE(VALUES(OrderTypeFactors[Factor]),OrderTypeFactors[Order Type]=SelectedOrderType)
RETURN
IF(OneOrderTypeSelected,[Average Qty Per Year By Type] * Factor,BLANK())
 
The resulting measures then look like:
 
related factor table.png

A PBIX which shows this can be viewed here

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.