Menu

Calculating Percentages, Growth, and Ranking

Calculating Percentages, Growth, and Ranking

Percentage of Total Sales

A percentage-of-total measure shows how much a category contributes to a larger total.

Sales Percentage =

DIVIDE(

[Total Sales],

CALCULATE(

[Total Sales],

REMOVEFILTERS(Products[Category])

),

0

)

When used in a visual grouped by category, this measure calculates each category's sales as a percentage of sales across all categories, while retaining other applicable filters.

Format the measure as a percentage in Power BI.

Month-over-Month Growth

Month-over-month growth measures the percentage change between the current month and the previous month.

The calculation follows this formula:

[
\text{Growth %} =
\frac{\text{Current Month Sales} - \text{Previous Month Sales}}
{\text{Previous Month Sales}}
\times 100
]

First, create a measure for the previous month's sales:

Previous Month Sales =

CALCULATE(

[Total Sales],

DATEADD(Calendar[Date], -1, MONTH)

)

Then calculate the growth percentage:

Month-over-Month Growth =

DIVIDE(

[Total Sales] - [Previous Month Sales],

[Previous Month Sales]

)

This calculation requires an appropriate Calendar table, a valid relationship to the sales dates, and a date context that supports the comparison. Format the result as a percentage.

Ranking Products

The RANKX function ranks values across a table.

For example:

Product Sales Rank =

RANKX(

ALL(Products[ProductName]),

[Total Sales],

,

DESC,

DENSE

)

This measure ranks products by total sales, with the highest sales receiving rank 1.

The ALL expression removes filters from the ProductName column for the ranking table, allowing products to be compared across categories while other applicable filters can still affect the calculation.

The DENSE option means that tied values receive the same rank and the next rank does not skip a number.

Ranking is useful for identifying top-selling products, highest-performing regions, and leading customers.


Power BI Tutorial

VA

Vishalini A



Learn via Video Course

Microsoft Power BI Logo

Microsoft Power BI

3 hrs



Get in Touch For Details