Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
09-03-2021 12:01 PM - last edited 09-04-2021 07:36 AM
This one is really more about typing a lot of numbers. Basically, presents unit conversion factors in VAR's for easy use in converting units from one to another.
Of all the Quick Measures I have submitted to the Gallery, I could actually envision something like this in the product. It would go under Mathematical and be called Unit Conversion. You could pick your Calculation, Sum, Average, etc. and a Base value. Then a drop down for "Units to convert" and a final drop down for "Units to convert to". The final formula could be something like:
Miles in Kilometers
VAR __UnitConversion = .6214
RETURN
SUM('Table'[Miles]) * __UnitConversion
Here is the formula for the current measure with a bunch of conversion factors listed:
Convert =
// Length
VAR __km2m = 1000
VAR __m2cm = 100
VAR __cm2m = POWER(10,-2)
VAR __mm2m = POWER(10,-3)
VAR __micron2m = POWER(10,-6)
VAR __millimicron2m = POWER(10,-9)
VAR __angstrom2m = POWER(10,-10)
VAR __in2cm = 2.54
VAR __ft2cm = 30.48
VAR __m2ft = 3.280839895
VAR __mile2km = 1.609
VAR __mil2in = POWER(10,-3)
VAR __cm2in = .3937
VAR __m2in = 39.37
VAR __km2mile = .6214
// Area
VAR __sqm2ftsq = 10.76
VAR __sqmile2acres = 640
VAR __sqft2sqcm = 929
VAR __acre2sqft = 43560
// Volume
VAR __l2cmcubed = 1000
VAR __l2qt = 1.057
VAR __l2incubed = 61.02
VAR __l2ftcubed = .03532
VAR __mcubed2l = 1000
VAR __mcubed2ftcubed = 35.32
VAR __ftcubed2USgal = 7.481
VAR __ftcubed2mcubed = .02832
VAR __ftcubed2l = 28.32
VAR __USgal2incubed = 231
VAR __USgal2l = 3.785
VAR __Britishgal2USgal = 1.201
VAR __Britishgal2incubed = 277.4
// Mass
VAR __kg2lb = 2.2046
VAR __kg2slug = .06852
VAR __lb2gm = 453.6
VAR __lb2slug = .03108
VAR __slug2lb = 32.174
VAR __slug2kg = 14.59
// Speed
VAR __kmh2msec = .2778
VAR __kmh2milesh = .6214
VAR __kmh2ftsec = .9113
VAR __mih2ftsec = 1.467
VAR __mih2kmh = 1.609
VAR __mih2msec = .4470
// Density
VAR __gmcmcubed2kgmcubed = POWER(10,3)
VAR __gmcmcubed2lbftcubed = 62.43
VAR __gmcmcubed2slugftcubed = 1.940
VAR __lbftcubed2gmcmcubed = .01602
VAR __slugftcubed2gmcmcubed = .5154
// Force
VAR __nt2dynes = POWER(10,5)
VAR __nt2kgwt = .1020
VAR __nt2lbwt = .2248
VAR __lbwt2nt = 4.448
VAR __lbwt2kgwt = .4536
VAR __lbwt2poundals = 32.17
VAR __kgwt2lbwt = 2.205
VAR __kgwt2nt = 9.807
VAR __USshortton2lbwt = 2000
VAR __longton2lbwt = 2240
VAR __metricton2lbwt = 2205
// Energy
VAR __joule2ntm = 1
VAR __joule2ergs = POWER(10,7)
VAR __joule2ftlbwt = .7376
VAR __joule2cal = .2389
VAR __joule2BTU = 9.481 * POWER(10,-4)
VAR __ftlbwt2joules = 1.356
VAR __ftlbwt2cal = .3239
VAR __ftlbwt2BTU = 1.285 * POWER(10,-3)
VAR __cal2joules = 4.186
VAR __cal2ftlbwt = 3.087
VAR __cal2BTU = 3.968 * POWER(10,-3)
VAR __BTU2ftlbwt = 778
VAR __BTU2Joules = 1055
VAR __BTU2watth = .293
VAR __kwhr2joules = 3.60 * POWER(10,6)
VAR __kwhr2kcal = 860
VAR __kwhr2BTU = 3413
VAR __ev2joule = 1.602 * POWER(10,-19)
// Power
VAR __watt2joulesec = 1
VAR __watt2ergssec = POWER(10,7)
VAR __watt2calsec = .2389
VAR __hp2ftlbwtsec = 550
VAR __ht2ftlbwtmin = 33000
VAR __hp2watts = 745.7
VAR __kw2hp = 1.341
VAR __kw2ftlbwtsec = 737.6
VAR __kw2BTUsec = .9483
// Pressure
VAR __ntmsquared2dynescmsquared = 10
VAR __ntmsquared2atm = 9.869 * POWER(10,-6)
VAR __ntmsquared2lbwtftsquared = 2.089 * POWER(10,-2)
VAR __lbwtinsquared2ntmsquared = 6895
VAR __lbwtinsquared2cmmercury = 5.171
VAR __lbwtinsquared2inwater = 27.68
VAR __atm2ntmsquared = 1.013 * POWER(10,5)
VAR __atm2dynescmsquared = 1.013 * POWER(10,6)
VAR __atm2lbwtinsquared = 14.70
VAR __atm2cmmercury = 76
VAR __atm2inwater = 406.8
// Temperature
VAR __F2Ra = 459.67 //use plus
VAR __C2Re = .8 //use mult
VAR __K2C = 273.15 //use subt
VAR __K2Ra = 1.8 // use mult
// Storage
VAR __B2kB = 1/1024
VAR __KB2MB = 1/1024
VAR __MB2GB = 1/1024
VAR __GB2TB = 1/1024
VAR __TB2PB = 1/1024
VAR __PB2EB = 1/1024
VAR __bit2B = .125
VAR __Kbit2kB = .125
VAR __Mbit2MB = .125
VAR __Gbit2GB = .125
VAR __Tbit2TB = .125
VAR __Pbit2PB = .125
VAR __Ebit2EB = .125
RETURN
MAX([Value]) * __km2m
eyJrIjoiMjU2ODUxZGYtMDQwNy00NDk1LWJiZGQtMzkzYjQ0NzMxZWMxIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9