Forum Discussion

Ericwhv's avatar
Ericwhv
Helper II
3 years ago
Solved

If Statement in Measurement

Hi All

Thank you for your help in advance.

i am trying to do a truck utilization for each lane

 

we have the fake details as below:

Truck_LaneChargeable 1:6
FRAMLH6814
FRACDG893
MLHCDG8731
BRUAMS913
LHRSNN8659
LHRBHX9028
LHRSNN828
BRUAMS7553
ISTFRA7719
FRABUD809

 

at the begining, i use below two mearsurement to calcuate the "Truck Utilization"

Avg Chrg Weight Per Truck = AVERAGE(Truck_Level[Chargeable 1:6])
Truck Utilization(AVG) = DIVIDE([Avg Chrg Weight Per Truck], 10666)
10666 is = 100% utilization
 
Now, we have some issue, we are using the same 1 truck to serve two lane
FRAMLH and MLHCDG, so, we cannot use these average weight per truck to divided by "10666" but "10666 / 2 = 5333"
 
Now, i want to write a meansurement that if.... the lane is FRAMLH or MLHCDG, we will need to divided by 5333 instead of 10666
 
how can i write a measurement add this if statement?
 
if(lane = FRAMLH or MLHCDG -> average weight per truck divided by 5333, rest divided by 10666

Thank you so much!
  • Ericwhv , Try like

     

    Truck Utilization(AVG) = DIVIDE([Avg Chrg Weight Per Truck], if(Max(Table[Truck_Lane])  in {"FRAMLH","MLHCDG"} , 5333, 10666))

1 Reply

  • Ericwhv , Try like

     

    Truck Utilization(AVG) = DIVIDE([Avg Chrg Weight Per Truck], if(Max(Table[Truck_Lane])  in {"FRAMLH","MLHCDG"} , 5333, 10666))