Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Textsplit command in Power BI

Hi,   I have a list of adresses with the age of the habitants of each adres. I'm trying to create a measure in Power BI to show the average age of each adress. However, as seen below the age  is di...
  • tamerj1's avatar
    3 years ago

    Hi Anonymous 

    please try

    Average Age =
    VAR String = 'Table'[Age]
    VAR Items =
    SUBSTITUTE ( String, ",", "|" )
    VAR Length =
    COALESCE ( PATHLENGTH ( Items ), 1 )
    VAR T =
    GENERATESERIES ( 1, Length, 1 )
    RETURN
    AVERAGEX ( SELECTCOLUMNS ( T, "@Item", PATHITEM ( Items, [Value] ) ), [@Item] )