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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
EugenioProlog
Helper I
Helper I

How to filter top N when metric has all values = 0?

Hello! I'm creating a "Salesman of the month" visual that displays the employee name on a column on my dim table of employees, using a visual filter, that shows the TOP N value based on a metric called [% Real. x Meta Vlr NMRR] 

that calculates de SUM of sales that they made in the current month. But whenever I have a new month, all values on this metric are equal to 0, so my visual displays a random name of a salesman, but i want it to display Blank() or NULL or something else.

How do I adapt my Filter in order to return nothing when all values of my metric are equal to zero?

 

EugenioProlog_0-1756736542917.png

 

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @EugenioProlog 

 

To avoid showing a random employee in that case, you can wrap your measure with a check. For example:

SalesMetricAdj =
IF (
   SUM ( FactSales[Metric] ) = 0,
   BLANK(),
   SUM ( FactSales[Metric] )
)

Or, if you want to check across the whole month:

SalesMetricAdj =
IF (
   CALCULATE ( SUM ( FactSales[Metric] ), ALL ( Employees ) ) = 0,
   BLANK(),
   SUM ( FactSales[Metric] )
)

Now use SalesMetricAdj in your Top N filter instead of the original metric. This way, when all values are 0, the measure returns BLANK, and the visual won’t show any salesman.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

1 REPLY 1
rohit1991
Super User
Super User

Hi @EugenioProlog 

 

To avoid showing a random employee in that case, you can wrap your measure with a check. For example:

SalesMetricAdj =
IF (
   SUM ( FactSales[Metric] ) = 0,
   BLANK(),
   SUM ( FactSales[Metric] )
)

Or, if you want to check across the whole month:

SalesMetricAdj =
IF (
   CALCULATE ( SUM ( FactSales[Metric] ), ALL ( Employees ) ) = 0,
   BLANK(),
   SUM ( FactSales[Metric] )
)

Now use SalesMetricAdj in your Top N filter instead of the original metric. This way, when all values are 0, the measure returns BLANK, and the visual won’t show any salesman.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors