Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello everyone, here I am counting weighted averages based on member data. The problem is that if I have empty values then my function takes into account these members and therefore calculations are not correct.
As you can see on my code I've applied to count only for member where value is >0.
Solved! Go to Solution.
HI @konwes97,
Perhaps you can try to add this filter on your parameter table to exclude these not match records before calculations:
formula =
MEDIANX (
SUMMARIZE (
FILTER ( '2021' , '2021'[COMP3TGT] > 0 ),
'2021'[SMI_CODE],
"Comp1 AVG", AVERAGE ( '2021'[COMP3TGT] )
),
[Comp1 AVG]
)
If the above formula does not help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hello,
I am using the formula above, however, some of the values are being ignored and therefore the medianx returns the wrong value.
I have a 3 tables that is filtered by the user via a slicer. They are copies of the same source, I am using SUMX, AVERAGEX and MEDIANX respectively, all works fine in the first two, only MEDIANX is ignoring some, sometimes all values, depending on the slicer selection.
Here is the formula:
HI @konwes97,
Perhaps you can try to add this filter on your parameter table to exclude these not match records before calculations:
formula =
MEDIANX (
SUMMARIZE (
FILTER ( '2021' , '2021'[COMP3TGT] > 0 ),
'2021'[SMI_CODE],
"Comp1 AVG", AVERAGE ( '2021'[COMP3TGT] )
),
[Comp1 AVG]
)
If the above formula does not help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@konwes97 , Check for non blank too
MEDIANX(SUMMARIZE('2021','2021'[SMI_CODE],"Comp1 AVG",
CALCULATE(AVERAGE('2021'[COMP3TGT]),'2021'[COMP3TGT]>0 && not(isblank([COMP3TGT])))),[Comp1 AVG])
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
83 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
129 | |
108 | |
63 | |
55 |