Forum Discussion
Raj123
2 years agoFrequent Visitor
Creating extra line or in totals showing the difference between two rows
Hi,
I have matrix visual which has AgentID in row and Date in Column- grill down to month and measure in values.
My condition is to create extra line in row or to show in total, the measure difference between "agentID 1" and "agentID 3"
(1-3).
I have added two sample table to show what i have and what i need.
Thanks in advance.
Current Output
| Year | 2022 | ||
| Agent ID | Jan | Feb | Mar |
| 1 | 10 | 20 | 30 |
| 2 | 5 | 10 | 15 |
| 3 | 2 | 4 | 6 |
| Total | 17 | 34 | 51 |
Required Output
| Year | 2022 | ||
| Agent ID | Jan | Feb | Mar |
| 1 | 10 | 20 | 30 |
| 2 | 5 | 10 | 15 |
| 3 | 2 | 4 | 6 |
| Total | 8 | 16 | 24 |
Raj123 try this, you can tweak the solution as you see fit.
Sales = SUM ( Table[Sales] ) Agent 1 Sales = CALCULATE ( Table[Sales], Table[Agent] = 1 ) Agent 3 Sales = CALCULATE ( Table[Sales], Table[Agent] = 3 ) Measure for Matrix = IF ( HASONEVALUE ( Table[Agent] ), [Sales], [Agent 1 Sales] - [Agent 3 Sales] )
4 Replies
- parry2k
Super User
Raj123 try this, you can tweak the solution as you see fit.
Sales = SUM ( Table[Sales] ) Agent 1 Sales = CALCULATE ( Table[Sales], Table[Agent] = 1 ) Agent 3 Sales = CALCULATE ( Table[Sales], Table[Agent] = 3 ) Measure for Matrix = IF ( HASONEVALUE ( Table[Agent] ), [Sales], [Agent 1 Sales] - [Agent 3 Sales] )