Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Measure = VAR Total_Sum = (SUM('UPS'[1st_UPS]) + SUM('UPS'[2nd_UPS]))
VAR Non_Zero_Count = SUMX('UPS',IF('UPS'[1st_UPS] = 0, 0, 1) + IF('UPS'[2nd_UPS] =0, 0, 1))
RETURN
if(Non_Zero_Count=0,0,Total_Sum/Non_Zero_Count)
Solved! Go to Solution.
Hi @cghanta ,
Thanks for using Microsoft Fabric Community,
To ensure that the measure remains unaffected by selection, you can use the ALL function to remove filters from the 'UPS' table. Try modifying your measure as follows:
Measure =
VAR Total_Sum = SUMX(ALL('UPS'), 'UPS'[1st_UPS] + 'UPS'[2nd_UPS])
VAR Non_Zero_Count =
SUMX(
ALL('UPS'),
IF('UPS'[1st_UPS] = 0, 0, 1) + IF('UPS'[2nd_UPS] = 0, 0, 1)
)
RETURN
IF(Non_Zero_Count = 0, 0, Total_Sum / Non_Zero_Count)
Tested this with sample data, and it works as expected:
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Best Regards,
Vinay.
Hi @cghanta ,
Thanks for using Microsoft Fabric Community,
To ensure that the measure remains unaffected by selection, you can use the ALL function to remove filters from the 'UPS' table. Try modifying your measure as follows:
Measure =
VAR Total_Sum = SUMX(ALL('UPS'), 'UPS'[1st_UPS] + 'UPS'[2nd_UPS])
VAR Non_Zero_Count =
SUMX(
ALL('UPS'),
IF('UPS'[1st_UPS] = 0, 0, 1) + IF('UPS'[2nd_UPS] = 0, 0, 1)
)
RETURN
IF(Non_Zero_Count = 0, 0, Total_Sum / Non_Zero_Count)
Tested this with sample data, and it works as expected:
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Best Regards,
Vinay.