Forum Discussion
zazaalaza
2 years agoFrequent Visitor
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...
- 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 )
AlexisOlson
Super User
2 years agoTry 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
)
- zazaalaza2 years agoFrequent Visitor
The totals are reversed, Should also be negative and positive 🙂 But cool, this already works
- AlexisOlson2 years ago
Super User
That's because the row/column value is blank for those, which is treated like a zero when compared to 1-10.
I don't know what totals actually make sense in your scenario, so I didn't attempt to adjust them.