cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JNelson
Frequent Visitor

Percentage calculated column

Hello!

 

I need some help with a Profit % calculated column. I think it is a very simple answer that I can't seem to see.

 

T_Profit = Table1[T_Revenue]-Table1[T_Cost]

T_Profit% = DIVIDE(Table1[T_Profit],Table1[T_Cost],0)

These two columns calculate fine on a row level, however, the Totals do not work, therefore when I try to put a Card visual for the overall T_Profit% is does not work. I don't know how to get the % of the total without it summing or averaging...

 

Example below

Percentage.JPG

When I pull it into a card I am forced to find a calculation eg. It's either Sum (37.20%) or Average (9.30%) when it should be 12.40% still.... 

Card.JPG

I think perhaps my DAX or my maths is incorrect. Can someone please provide me with a more effective DAX. Should I use a measure instead?

 

Thanks!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Yes, you should use measures instead. When you add a column to a visual like that Power BI will automatically create implicit measures anyway, better to do it yourself. You can also use the measures you define as building blocks for further measures, e.g.

Revenue = SUM(Table1[T_Revenue])

Cost = SUM(Table1[Cost])

Profit = [Revenue] - [Cost]

Profit % = DIVIDE( [Profit], [Cost], 0)

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Yes, you should use measures instead. When you add a column to a visual like that Power BI will automatically create implicit measures anyway, better to do it yourself. You can also use the measures you define as building blocks for further measures, e.g.

Revenue = SUM(Table1[T_Revenue])

Cost = SUM(Table1[Cost])

Profit = [Revenue] - [Cost]

Profit % = DIVIDE( [Profit], [Cost], 0)

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors