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
Luke_Howells
Helper I
Helper I

Ignore Blanks in Measure Result

Hi All, I have a measure below which calculates the number of hours lost over a date range but also includes the 3 months prior based on the earliest date selected in the date filter. I am trying to get an average result which it is producing but also includes months where there are no hours lost. I only want the result to show an average where there are months with hours lost. Any ideas?

 

Hours Lost Result.JPG

 

This is the measure being used. 

 

Average Hours Lost Over Date Range and 3 Months = CALCULATE(
                SUM('07 - COVID Absence Record'[Hours Lost (4)]),
                    DATESBETWEEN('01. Date Table'[Date],
                        FIRSTDATE('01. Date Table'[Date Minus 3 Months]),
                            LASTDATE('01. Date Table'[Date])))

/

ROUNDDOWN(((ROUND(LASTDATE('01. Date Table'[Date]) - FIRSTDATE('01. Date Table'[Date Minus 3 Months]),0)) / 7),0)

 

 

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

Hi, @Luke_Howells ;

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Luke_Howells ;

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
Community Support

Hi, @Luke_Howells ;

 

You can modify your measure by adding filter ('07 - COVID Absence Record'[Hours Lost (4)]<>blank()),
Or additionally create a measure to count the total number of non-zero months;

 

Or Could you please consdier sharing a sample file without any sesentive information and posting expected result so it is clear on your logic?
It makes it easier to give you a solution.

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Samarth_18
Community Champion
Community Champion

Hi @Luke_Howells ,

 

Have you tried to use is not blank filter on your visual.

 

Samarth_18_0-1644844101799.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.