The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the July 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
108 | |
69 | |
46 | |
43 |
User | Count |
---|---|
188 | |
87 | |
77 | |
74 | |
60 |