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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
yts61
Microsoft Employee
Microsoft Employee

How to get the indexed monthly sales value basing on a specific year?

Hello everyone!

 

In my data base, I have data of 2019, 2020, 2021. They are weekly sales data. Right now, i am going to benchmark the sales of 2021 to the sales of 2019. In excel , it is simple, I will just use sales_2021/Average(sales_2019) to get index, and then i can pull a beautiful trend line of the indexed weekly sales. The attached pic below is an example of how I would do in excel. The Average() fucntion is the average of sales in 2019. 

This is how i would do in excelThis is how i would do in excel

 

But Right now, I want do do it in Powerbi,

Here is the view of it:

Screenshot 2022-07-25 125221.jpg

I did 2 filtering here, one is teh category "Computers", and then it is the "Consumer Electronics" within it. The Sales is the Sum of sales of the week. 

Screenshot 2022-07-25 124542.jpg

 

So my goal now is to create in index column, and plot it like what i do in Excel.
Would anyone please help?

1 REPLY 1
SpartaBI
Community Champion
Community Champion

@yts61 
I'm assuming by what you wrote the granularity is by week and that you have a dates dimension that I called it 'Calendar' that has the week column in it for you to use as the x axis in your chart and then you basically need to choose only 2021 in the slicer and create this measure:

 

Index =
VAR _average_2019 = CALCULATE(AVERAGE('Table'[Sales]), 'Calendar'[Year] = 2019)
VAR _sales = CALCULATE(SUM('Table'[Sales]))
VAR _result = 
    DIVIDE(_sales, _average_2019)
RETURN
    _result

 

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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