Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi @ashwinil,
I'd like to suggest you enter to query editor to do unpivot column function on your fields to transform these value filed to attribute and value, then create a matrix visual with measure to achieve your requirement.('for P&L' to row, 'attribute' to column)
Sample formula:
Measure =
VAR _expense =
CALCULATE (
SUM ( Table[Value] ),
FILTER ( ALLSELECTED ( Table ), Table[Attribute] = "Salary" ),
VALUES ( Table[For P&L] )
)
- CALCULATE (
SUM ( Table[Value] ),
FILTER ( ALLSELECTED ( Table ), Table[Attribute] = "Travel" ),
VALUES ( Table[For P&L] )
)
RETURN
IF (
SELECTEDVALUE ( Table[For P&L] ) = "Expense",
_expense,
IF (
SELECTEDVALUE ( Table[For P&L] ) = "Gross Margin",
CALCULATE (
SUM ( Table[Value] ),
ALLSELECTED ( Table ),
VALUES ( Table[Attribute] )
)
- _expense,
CALCULATE (
SUM ( Table[Value] ),
ALLSELECTED ( Table ),
VALUES ( Table[Attribute] ),
VALUES ( Table[For P&L] )
)
)
)
BTW, I have found any expense records in your table, did it real existed in your table? If not, you need to create a custom P&L table with related values, then use that value for calculate.
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 68 | |
| 46 | |
| 44 | |
| 29 | |
| 20 |
| User | Count |
|---|---|
| 202 | |
| 130 | |
| 102 | |
| 71 | |
| 55 |