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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
cflynn_29
Helper I
Helper I

Getting a Measure to read ZERO (0) when the slicers read all selected

Hi All,

 

I have the following measure 

 

2.6 = MAXX(VALUES(Data[School]), [Area max per School])
                                  Table - Column - Measure
 
But when the School Filter reads ALL i would like to read (0) until a school is selected. Will a selected value work? Or anything really i havent been terrbily successful.
 
Thank you,
1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi @cflynn_29 

 

have you tried to write your measure like this?

2.6 = if(hasonevalue(data[school]),MAXX(VALUES(Data[School]), [Area max per School]),0)

 

Cheers,
Sturla

View solution in original post

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi @cflynn_29 

 

have you tried to write your measure like this?

2.6 = if(hasonevalue(data[school]),MAXX(VALUES(Data[School]), [Area max per School]),0)

 

Cheers,
Sturla

Anonymous
Not applicable

Don't understand why there's MAXX in there... This returns the same output:

if( hasonevalue( data[school] ),
   [Area max per School],
   0
)

which can also be compacted to:

hasonevalue( data[school] ) * [Area max per School]

 

The two (and the one given by @sturlaws) are exactly the same.

 

Best

D

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.