Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amaniramahi
Helper V
Helper V

Calculated measure in column chart

Hi,

 

I have a table contains Cost and sales for many models, I managed to create a measure to calculate the profit margin (difference between them divided by the sales).

now i want to create a visulaization (column chart) to show the value of profit margin by Model, but I do so I cannot add the measure to value field.

 

When I try to add a chart visualization with the model and profit margin for each one, the figures appear properly.

 

where is my mistake?

1 ACCEPTED SOLUTION

Hi @amaniramahi 

 

In the modeling tab from Power BI Desktop you will find the formatting option in the 'Formatting' section for percentages.

 

If your measure is persisted in a ssas model, click on the measure field. The properties pane should show on the bottom right. Here you can pick the option percentage and enter the correct amount of decimals under the option 'Decimal Places'.

 

If this post helps, then please consider Accept it as the solution.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @amaniramahi ,

 

You need to create a measure “profit margin”.

profit margin =
CALCULATE (
    ( SUM ( 'Table'[sales] ) - SUM ( 'Table'[cost] ) )
        / SUM ( 'Table'[sales] )
)

It is important to note that you want to change the data type of the measure to a decimal and keep two decimal places. If it is represented as whole number, it may be all 0.

Then you can create a column visual based on these fields.

I did not find any problems while testing, you can check the version of PowerBI and update to the latest version.

 

 

1-1.PNG

 

1-2.PNG

 

 

 

 

 

 

 

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank you @v-eachen-msft , but the  problem is that I want to display the results  in % format. once I use FORMAT expression the results cannot  be visualized ..

Is there anyway to display them as % rather than fractions?

Hi @amaniramahi 

 

In the modeling tab from Power BI Desktop you will find the formatting option in the 'Formatting' section for percentages.

 

If your measure is persisted in a ssas model, click on the measure field. The properties pane should show on the bottom right. Here you can pick the option percentage and enter the correct amount of decimals under the option 'Decimal Places'.

 

If this post helps, then please consider Accept it as the solution.

Thank you @MauriceMecowe !! it worked 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.