Forum Discussion
Ericwhv
3 years agoHelper II
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_Lane | Chargeable 1:6 |
| FRAMLH | 6814 |
| FRACDG | 893 |
| MLHCDG | 8731 |
| BRUAMS | 913 |
| LHRSNN | 8659 |
| LHRBHX | 9028 |
| LHRSNN | 828 |
| BRUAMS | 7553 |
| ISTFRA | 7719 |
| FRABUD | 809 |
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!
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
- amitchandakSuper User
Ericwhv , Try like
Truck Utilization(AVG) = DIVIDE([Avg Chrg Weight Per Truck], if(Max(Table[Truck_Lane]) in {"FRAMLH","MLHCDG"} , 5333, 10666))