Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Measure text string

How do I calculate a measure of a text column? 

Calculated Column:

Reply time cal. hours =
VAR currentNum = 'Table'[REPLY_TIME_IN_CALENDAR_MINUTES]
RETURN
RIGHT("0" & INT (currentNum/60),2) & ":" &
RIGHT("0" & INT(MOD(currentNum,60)),2) & ":" &
RIGHT("0" & INT(MOD(currentNum,1)),2)
 
Measure: 
Measure = AVERAGE('Table'[Reply time cal. hours])
 
See Images: 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous,

    Current power bi data model table not support duration types. According to your description and snapshot, it seems like you convert these value to text type to keeping the format.
    For this scenario, these values are stored as text and you can't use common math aggregation functions on it. I'd like to suggest you convert them to total seconds instead.

    Aggregating Duration Time 

    Regards,

    Xiaoxin Sheng

2 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    you cannot use an average for a text colum.

    But you could use MAX('Table'[Reply time cal. hours]) to give back a text.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Current power bi data model table not support duration types. According to your description and snapshot, it seems like you convert these value to text type to keeping the format.
    For this scenario, these values are stored as text and you can't use common math aggregation functions on it. I'd like to suggest you convert them to total seconds instead.

    Aggregating Duration Time 

    Regards,

    Xiaoxin Sheng