Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi
I would like to average the result from one of my measure (Column B).
According to the above picture, column B is the result from this measure
HC-Resign
HC = CALCULATE(COUNT('HC'[Employee ID]),'Attrition'[PE]="1")
Solved! Go to Solution.
Hi @JULY1
please try
Average =
VAR CurrentDate =
MAX ( 'Data as of_LookUp'[Data as of] )
VAR SelectedMonths =
CALCULATETABLE (
VALUES ( 'Data as of_LookUp'[YearMonth] ),
ALLSELECTED ( 'Data as of_LookUp' ),
'Data as of_LookUp'[Data as of] <= CurrentDate
)
RETURN
AVERAGEX (
SelectedMonths,
VAR CurrentMonth = 'Data as of_LookUp'[YearMonth]
RETURN
CALCULATE (
[HC],
'Data as of_LookUp'[YearMonth] = CurrentMonth,
ALLSELECTED ( 'Data as of_LookUp' )
)
)
Hi @JULY1
please try
Average =
VAR CurrentDate =
MAX ( 'Data as of_LookUp'[Data as of] )
VAR SelectedMonths =
CALCULATETABLE (
VALUES ( 'Data as of_LookUp'[YearMonth] ),
ALLSELECTED ( 'Data as of_LookUp' ),
'Data as of_LookUp'[Data as of] <= CurrentDate
)
RETURN
AVERAGEX (
SelectedMonths,
VAR CurrentMonth = 'Data as of_LookUp'[YearMonth]
RETURN
CALCULATE (
[HC],
'Data as of_LookUp'[YearMonth] = CurrentMonth,
ALLSELECTED ( 'Data as of_LookUp' )
)
)
Hi @tamerj1
Sorry to bother you again.
It worked at first but after I played around with something else and came back, I found that the result has changed and it's not correct anymore 😢
Could you help me figure this out again.
The result column was from the DAX you provided earlier, it looks like it was divided by 1 in January, 1.99 in February, 2.98 in March, while it should be divided by 1 2 3 respectively in order to calculate the average.
Thank you.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
18 | |
17 | |
16 |
User | Count |
---|---|
29 | |
27 | |
19 | |
15 | |
14 |