Forum Discussion

SanderB's avatar
SanderB
Frequent Visitor
7 years ago
Solved

Avererage in column with variant data type

Hi all, I am stuck in the matrix table in PowerBI. See data below. Column VALUE is formatted as numbers, TEXT as text and U_RPT_VALUE also as text. TEST_NUMBER NAME VALUE TEXT U_RPT_VALUE ...
  • Mariusz's avatar
    7 years ago

    Hi SanderB 

     

    Try the below

    Measure = 
    VAR _text = SELECTEDVALUE( 'Table'[U_RPT_VALUE] )
    VAR _search = SEARCH( "<", _text, 1, 0 ) > 0
    RETURN IF( _search, _text, AVERAGE( 'Table'[VALUE] ) )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski