Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I have the following data set:
I have created a measure to calculate percentage as
The problem is- It is actually calculating average of percentages for two months = (42.86%+85%)/2=63.93%
which is not the correct way of taking average. It should be actually 74.07%
= 20/27
Solved! Go to Solution.
Hi @deedeedudu
If you want to take average of last n months, just filter the table when you do sumx() operation, such like,
line =
VAR _start =
EOMONTH ( today, - n ) // it is suggested to use eomonth instead of edate in this scenario
RETURN
IF (
MIN ( Sheet1[Date] ) <> BLANK (),
SUMX ( FILTER ( ALL ( Sheet1 ), Sheet1[Date] > _start ), Sheet1[Numerator] )
/ SUMX ( FILTER ( ALL ( Sheet1 ), Sheet1[Date] > _start ), Sheet1[Denominator] )
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @deedeedudu
Thanks for reaching out to us.
For average, it does take the average(63.93%) of all endpoints instead of 74.07%. If you want to get 74.07%, you need to create a measure, and change the visual to those that support line.
line = IF(MIN(Sheet1[Date])<>BLANK(),SUMX(ALL(Sheet1),Sheet1[Numerator])/SUMX(ALL(Sheet1),Sheet1[Denominator]))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply. Is there any way I can take average of last n months instead of selecting All?
Hi @deedeedudu
If you want to take average of last n months, just filter the table when you do sumx() operation, such like,
line =
VAR _start =
EOMONTH ( today, - n ) // it is suggested to use eomonth instead of edate in this scenario
RETURN
IF (
MIN ( Sheet1[Date] ) <> BLANK (),
SUMX ( FILTER ( ALL ( Sheet1 ), Sheet1[Date] > _start ), Sheet1[Numerator] )
/ SUMX ( FILTER ( ALL ( Sheet1 ), Sheet1[Date] > _start ), Sheet1[Denominator] )
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
80 | |
60 | |
59 | |
58 |
User | Count |
---|---|
157 | |
119 | |
104 | |
77 | |
69 |