Forum Discussion
Anonymous
4 years agoNot applicable
Table Visualization Line Calculations
Is it possible to insert into a table visualization a row with a calculation based on other row values? Current Period Data Source Sales $1,00...
v-kelly-msft
4 years agoCommunity Support
Hi Anonymous ,
You could also create a calculated table as below:
New table =
VAR _profit =
CALCULATE (
SUM ( 'Table'[Current Period ] ),
FILTER ( 'Table', 'Table'[category] = "Gross Profit" )
)
VAR _expense =
CALCULATE (
SUM ( 'Table'[Current Period ] ),
FILTER ( 'Table', 'Table'[category] = "Expenses" )
)
VAR _sales =
CALCULATE (
SUM ( 'Table'[Current Period ] ),
FILTER ( 'Table', 'Table'[category] = "Sales" )
)
RETURN
UNION (
SELECTCOLUMNS (
'Table',
"category", 'Table'[category],
"Current Period", FORMAT ( 'Table'[Current Period ], "$#,##0" )
),
ROW (
"category", "Profit",
"Current Period", FORMAT ( _profit - _expense, "$#,##0" )
),
ROW (
"category", "Profit%",
"Current Period", FORMAT ( DIVIDE ( _profit - _expense, _sales ), "percent" )
)
)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- Anonymous4 years agoNot applicable
Hello Kelly, I am encountering an error when I set up the calculated new table using my data. Any suggestions?
Thanks for the sharing this approach.
Tim
- v-kelly-msft4 years agoCommunity Support
Hi Anonymous ,
Cant tell why by the screenshot.
Could you pls share me your .pbix file for test?
Remember to remove the confidential information.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
- v-kelly-msft4 years agoCommunity Support
Hi Anonymous ,
Is your issue solved now?
If so,could you pls mark the reply as answered to close it?
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!