Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Multiply a time count

Hi All, 

 

I am new to PBI and I need some support, I am trying to multiply the values sitting on top of the bar graphs by the time values at the bottom of the graph. 

The values is a count of Time, so in the image its showing that there are 4 ID values x 00:30:00 and the end result I would like to see is 4 x 00:30:00 = 02:00:00 as the whole time of the 4 ID's in the graph. 

 

The field is currently looking at the count of the column Time and the Axis are ID numbers- 

 

I know from past experience that we are unable to do this with a TEXT column so can anyone give me some advice as to how I can achieve the amount of ID numbers x count of ID time logged. 

 

Thanks 

 

 

 

 

  • v-yingjl's avatar
    v-yingjl
    4 years ago

    Hi Anonymous ,

    You can try this measure to get the result but actually text value could not be used in the bar chart singlly.

    Total Time =
    CONVERT (
        CONVERT (
            CONVERT ( CONVERT ( SELECTEDVALUE ( 'Table'[Time] ), DATETIME ), DOUBLE )
                * COUNT ( 'Table'[ID] ),
            DATETIME
        ),
        STRING
    )
    

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies