Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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
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
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |