Forum Discussion

zazaalaza's avatar
zazaalaza
Frequent Visitor
2 years ago
Solved

Unsolvable DAX conundrum in Matrix Visual?

Hi, I have a matrix visual that is made from 2 unrelated tables and measures that executes against those 2 tables. Test Measures:  Positive = IF ( SELECTEDVALUE ( 'Columns'[Valu...
  • AlexisOlson's avatar
    2 years ago

    Try this:

    VAR _Row = SELECTEDVALUE ( 'Rows'[Value] )
    VAR _Col = SELECTEDVALUE ( 'Columns'[Value] )
    RETURN
        SWITCH (
            TRUE (),
            _Row < _Col, RANDBETWEEN ( 10, 100 ),
            _Row > _Col, RANDBETWEEN ( 10, 100 ) * -1
        )