Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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 excel
But Right now, I want do do it in Powerbi,
Here is the view of it:
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.
So my goal now is to create in index column, and plot it like what i do in Excel.
Would anyone please help?
@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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |