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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How to calculate weight in dax

I have two measures in my model(Velocity, Carry Over). I would like to calculate the weight of this measures and create a new measure using the below logic.
If  Velocity >85 then set Score=5 
else If  Velocity is >70 and <85 set score=3 
else If  Velocity <70 then set score=1
   then multiply resulted score by 60%(weight-0.6) then store the Result 1.

If Carry Over <10 then set Score=5
else If Carry Over is > 10 and <20 then set Score=3
else If Carry Over is > 20 then set Score=1
    
    Then multiply resulted Score by 40%(weight-0.4) and store the Result 2.
    

then Desired value Final Measure =Result 1+ Result 2

I am new bae to dax and powerbi..I appreciate the help.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

I created the measure, you need to replace the measure names and use it.

Measure = 
var _v =  [Velocity]
var _c =  [Carry Over]
var _result1  = 
    SWITCH(
        TRUE(),
        _v > 85, 5,
        _v > 70 && _v < 85 , 3,
        _v < 70, 1
    ) * .6
var _result2  = 
    SWITCH(
        TRUE(),
        _c > 20, 1,
        _c > 10 && _c < 20 , 3,
        _c < 10, 5
    ) * .4
var _finalresult = _result1 + _result2
return
    _finalresult
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can clearly understand your requirement, I think you can create a measure like this to achieve your requirement:

Desired value =

var _velocity=

SWITCH(

    TRUE(),

    [Velocity]>85,5,

    [Velocity]>70&&[Velocity]<85,3,

    [Velocity]<70,1)

var _carryover=

SWITCH(

    TRUE(),

    [Carry Over]<10,5,

    [Carry Over]>10&&[Carry Over]<20,3,

    [Carry Over]>20,1)

return

_velocity*0.6+_carryover*0.4

Then you can create a table chart to place it like this:

v-robertq-msft_0-1622603492458.png

 

And you can get what you want.

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@Anonymous 

I created the measure, you need to replace the measure names and use it.

Measure = 
var _v =  [Velocity]
var _c =  [Carry Over]
var _result1  = 
    SWITCH(
        TRUE(),
        _v > 85, 5,
        _v > 70 && _v < 85 , 3,
        _v < 70, 1
    ) * .6
var _result2  = 
    SWITCH(
        TRUE(),
        _c > 20, 1,
        _c > 10 && _c < 20 , 3,
        _c < 10, 5
    ) * .4
var _finalresult = _result1 + _result2
return
    _finalresult
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Kudoed Authors