Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Community,
I would like to create a new average column in my table that is exemplified below. This average should be calculated by month and by category.
Date | Category | Value |
2022-01-01 | A | 12000 |
2022-01-01 | B | 87000 |
2022-01-01 | C | 38000 |
2022-01-01 | D | 91000 |
2022-01-02 | A | 11000 |
2022-01-02 | B | 85000 |
2022-01-02 | C | 38000 |
2022-01-02 | D | 90000 |
2022-01-03 | A | 11500 |
2022-01-03 | B | 12000 |
2022-01-03 | C | 38500 |
2022-01-03 | D | 91000 |
Thanks in advance for your help
Fabio
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new column.
avg by month and category CC =
VAR currentmonthend =
EOMONTH ( Data[Date], 0 )
VAR currentcategory = Data[Category]
VAR result =
AVERAGEX (
FILTER (
Data,
EOMONTH ( Data[Date], 0 ) = currentmonthend
&& Data[Category] = currentcategory
),
Data[Value]
)
RETURN
result
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new column.
avg by month and category CC =
VAR currentmonthend =
EOMONTH ( Data[Date], 0 )
VAR currentcategory = Data[Category]
VAR result =
AVERAGEX (
FILTER (
Data,
EOMONTH ( Data[Date], 0 ) = currentmonthend
&& Data[Category] = currentcategory
),
Data[Value]
)
RETURN
result
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question.
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |