Forum Discussion
raima7
10 years agoNew Member
Function convert in Power BI
Hello everybody, :) I'm trying to assign my datas to a unit of measure (kgs, lbs, tons) and I would like to convert them. Someone would have any idea? Thanks
- 10 years ago
Supposing there're trans and rates tables as below
Create a measure as
Total Mass = IF ( ISFILTERED ( Rate[TO_UNIT] ) && HASONEVALUE ( Rate[TO_UNIT] ), SUMX ( Trans, Trans[AMOUNT] * LASTNONBLANK ( Rate[RATE], "" ) ) & " " & LASTNONBLANK ( Rate[TO_UNIT], "" ) & "s", SUMX ( Trans, Trans[AMOUNT] * LASTNONBLANK ( 'Default Rate'[RATE], "" ) ) & " " & LASTNONBLANK ( 'Default Rate'[TO_UNIT], "" ) & "s" )Then use a Slicer to determine the converting UNIT. By default, it shows as kgs.
Choose lbs
Choose tons
Check more details in the attached pbix. If it answers your question, please accept it as solution. For any question, feel free to let me know. :)
Jessikampos
9 years agoNew Member
Please,
Could someone tell me how I can do a functoin to divide a number by 1000,00.
For exemple: I need to convert 1000,00 Kg in 1 TO.
I habe just one column. I've tried to do what raima7 said, but I didn't have success.
Thank you!