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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors