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.
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?
Solved! Go to 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.
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.
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |