Forum Discussion
BCWdesign
3 years agoFrequent Visitor
Convert months into years and months
Hi I hope someone can help I have a column in powerbi which shows months E.g 18 months I want a formulae to create a column which converts this to years and months E.g 1 year 6 months Hop...
- 3 years ago
Ahmedx
Super User
3 years agopls try this
Column =
VAR _year = INT([Value]/12)
VAR _Month = [Value]-_year*12
RETURN
SWITCH(
TRUE(),
[Value] < 12,"0 Year, " & [Value] & " Month",
[Value] =12 ,"1 Year, " & "0 Month",
_year &" Year, " &_Month & " Month")