Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
cghanta
Helper I
Helper I

Power BI - how to all ALL(Table) to a measure - remove all filters

How can I add ALL(UPS) to the following measure, so the card value will remain the same all the time:
The value is changing when rows of a table is selected.

 

 

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)

1 ACCEPTED SOLUTION
v-veshwara-msft
Community Support
Community Support

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:

vveshwaramsft_0-1743398893317.png  vveshwaramsft_2-1743398919827.png

 

 

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.

View solution in original post

2 REPLIES 2
v-veshwara-msft
Community Support
Community Support

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:

vveshwaramsft_0-1743398893317.png  vveshwaramsft_2-1743398919827.png

 

 

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.

Thank you! @v-veshwara-msft

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors