Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am capturing data for prices of products. The issue I am having is that the units of measure (UOM) are different around the world. I need to be able to convert price per liter to price per gallon and vice versa, so that a slicer can be applied for the relevant UOM.
Prices are all in USD, so at least this does not need to be converted.
Solved! Go to Solution.
Hi @Anonymous ,
As far as I know, the convert between liters and gallons should be 1 L = 0.26 gal.
I think you can refer to my sample.
Data table:
Unit:
Measure:
Price convert(liters/gallons) =
VAR _SELECTUNIT =
SELECTEDVALUE ( Unit[Unit] )
VAR _PRICE =
CALCULATE ( SUM ( 'Table'[Price per unit] ) )
VAR _CONVERT =
IF (
SELECTEDVALUE ( 'Table'[Unit] ) = _SELECTUNIT,
_PRICE,
IF ( _SELECTUNIT = "liters", _PRICE / 0.26, _PRICE * 0.26 )
)
RETURN
IF ( ISFILTERED ( Unit[Unit] ), _CONVERT, BLANK () )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
As far as I know, the convert between liters and gallons should be 1 L = 0.26 gal.
I think you can refer to my sample.
Data table:
Unit:
Measure:
Price convert(liters/gallons) =
VAR _SELECTUNIT =
SELECTEDVALUE ( Unit[Unit] )
VAR _PRICE =
CALCULATE ( SUM ( 'Table'[Price per unit] ) )
VAR _CONVERT =
IF (
SELECTEDVALUE ( 'Table'[Unit] ) = _SELECTUNIT,
_PRICE,
IF ( _SELECTUNIT = "liters", _PRICE / 0.26, _PRICE * 0.26 )
)
RETURN
IF ( ISFILTERED ( Unit[Unit] ), _CONVERT, BLANK () )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |