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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.