Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Power BI community,
I am currently trying to create a column that is able to multiply a whole number and the decimal from the same value by a different factor. The value that I am trying to converse is a leadtime with the following logic:
Value: 0,2 = 1 (working) day leadtime
Value: 0,4 = 1 (working) day leadtime etc..
Value: 1 = 1 week leadtime
Value: 2 = 2 weeks leadtime etc..
Value: 3,4 = 3 weeks and 2 (working) days leadtime
Value: 4,8 = 4 weeks and 4 (working) days leadtime etc...
I want to have a column that gives the leadtime in days. For this the decimal numbers need to be multiplied by a factor of 5 and the whole numbers need to be multiplied by a factor of 7. As some leadtimes do have a whole and decimal value it is possible that the whole- and decimal number need to be multiplied seperately and summed afterwards. I cannot figure out a way to single out the whole- and decimal numbers. I could do this by setting up the SWITCH function for every single value, but I am sure there is a better way to do this. The image below is an example of the calculated column I setup for now (I am aware the else simply multiplies everything by 7 and therefore does give what I need).
Solved! Go to Solution.
hi @Anonymous
not sure if i fully get you, try to add a calculated column like:
Column = INT([Value])*7+([Value]-INT([Value]))*5
it worked like:
Hi @Anonymous
for a calculated column you may try
Lead Time Conversie =
VAR String =
FORMAT ( Tbl_Artikelen[Lead Time], "#.0" )
VAR Items =
SUBSTITUTE ( String, ".", "|" )
RETURN
PATHITEM ( Items, 1 ) * 7
+ PATHITEM ( Items, 2 ) * 5
for a measure try
Lead Time Conversie =
SUMX (
VALUES ( Tbl_Artikelen[Lead Time] ),
VAR String =
FORMAT ( Tbl_Artikelen[Lead Time], "#.0" )
VAR Items =
SUBSTITUTE ( String, ".", "|" )
RETURN
PATHITEM ( Items, 1 ) * 7
+ PATHITEM ( Items, 2 ) * 5
)
hi @Anonymous
not sure if i fully get you, try to add a calculated column like:
Column = INT([Value])*7+([Value]-INT([Value]))*5
it worked like:
@FreemanZ Hey,
This gives the results I was looking for and taught me the INT function, thank you so much! 😊