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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Exclude 0 and blank from my Output

Hi Team,

 

Need qucik help,

I have a measure and my ouput but I have to exclude 0 and blanks from output, I can do it in Visual level filter but instead need to get it from my measure directly, please help me.

Rakeshss_0-1715852569776.png

Monday_Snapshot_Total =
var selectedMondayDate = MIN(KH_Calendar[Date])+1
VAR WeekDates   = DATEADD(KH_Calendar[Date],MAX(Frozen_Horizon[Fixed Horizon (Weeks)])*7,DAY)
VAR total = CALCULATE(SUM(EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[QUANTITY]),
WeekDates,
EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[SNAPSHOT_DATE].[Date] = selectedMondayDate)
RETURN total
 
 
Thanks!
2 REPLIES 2
hackcrr
Super User
Super User

Hi, @Anonymous 

To exclude zero and blank values directly in your measure, you can modify your DAX code to return BLANK() when the result is zero or null. This way, you won't need to rely on visual-level filters. Here's an updated version of your measure:

Monday_Snapshot_Total =
VAR selectedMondayDate = MIN(KH_Calendar[Date]) + 1
VAR WeekDates = DATEADD(KH_Calendar[Date], MAX(Frozen_Horizon[Fixed Horizon (Weeks)]) * 7, DAY)
VAR total = CALCULATE(
    SUM(EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[QUANTITY]),
    WeekDates,
    EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[SNAPSHOT_DATE].[Date] = selectedMondayDate
)
RETURN IF(total = 0 || ISBLANK(total), BLANK(), total)

 

Best Regards,

hackcrr

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@hackcrr ,

 

Thanks for your response ,
After modifying I still see blanks

Rakeshss_0-1715865614563.png

Solver Quantity =
VAR selectedMondayDate = MIN(KH_Calendar[Date]) + 1
VAR WeekDates = DATEADD(KH_Calendar[Date], MAX(Frozen_Horizon[Fixed Horizon (Weeks)]) * 7, DAY)
VAR total = CALCULATE(
    SUM(EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[QUANTITY]),
    WeekDates,
    EU_OMP_PROD_LOC_PLANVIEW_DAILY_FACT[SNAPSHOT_DATE].[Date] = selectedMondayDate
)
RETURN IF(total = 0 || ISBLANK(total), BLANK(), total)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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