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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
OZEEE
Frequent Visitor

% of days where value is 0

I am trying to calculate the % of days where the value is 0.  Below is sample data. Underlying dataset has multiple values each day. I need to know if the total of all values for a day is above 0. Then what percent of days are above 0

count 000-0700.PNG

5 REPLIES 5
Nathaniel_C
Community Champion
Community Champion

Hi @OZEEE 

See this picture, at the left is my data table, with 10 rows, and June 2 has a report of 0 and 2. There are actually 8 distinct dates, so my measure [Distinct Values] gives you the denominator. Then for the numerator, I used SUMMARIZE() to group by date, so we lost one day = 0. Use the measure [Summarize] for the numerator. I put the measure [Percent of Days 2] in the editing bar at the top. ([The Percent of Days] is superseded by the [Percent of Days 2].)

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

Percent of days 2.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nathaniel_C
Community Champion
Community Champion

Hi @OZEEE ,

 

Rather than assuming 365, you can use this measure to count the unique entries in your date column for the denominator.

Distinct Values = COUNTROWS(DISTINCT(AboveZ[DOS]))

 

Days of zero.PNG

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Nathaniel_C
Community Champion
Community Champion

@OZEEE ,

Try this... If you use the numerator as another measure, it will give you the count.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Percent zero.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Nathan,

 

The problem with this is that each row isn't a distinct date. For example, I could have two values on 6/1/2018, but I still need that to count as 1 "non-zero day". The dates with more than than one value will distort the calculation I am looking for.  I guess another way to word it is, "What percent of the time is the sum of a day 0 throughout the year"

 

Any thoughts?  The denominator should be 365 when analyzing a year's worth of data

Hi @OZEEE ,

Tell me more. On 6/1/2018 you say that you can have two values. Could they both be zero, could one be zero and the other not? What happens then? 

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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