Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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'[Value] ) = SELECTEDVALUE ( 'Rows'[Value] ),
BLANK(),
RANDBETWEEN ( 10, 100 )
)
Negative =
IF (
SELECTEDVALUE ( 'Columns'[Value] ) = SELECTEDVALUE ( 'Rows'[Value] ),
BLANK(),
RANDBETWEEN ( 10, 100 ) * - 1
)
What I would like to do is to merge the 2 measures such that the positive values display above the diagonal line and the negative values are displayed below the negative values.
I am having problems even approaching the issue, here is the powerbi file for reference: https://file.io/ZPVaVYkPmMrz
Would really appreciate if someone could point me in the right direction.
Solved! Go to Solution.
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
)
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
)
The totals are reversed, Should also be negative and positive 🙂 But cool, this already works
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
26 | |
20 | |
14 | |
8 |
User | Count |
---|---|
75 | |
47 | |
45 | |
17 | |
16 |