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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Measures to calculate Min Date, Max, Date, and Averages if Open or Closed

Hi,

I have a bunch of projects where I am trying to get a table with average days to close and days since opened to today and ignoring any zeroes.

My Data and results look like this and Start Date is linked to  Calendar Table. 

Issue KeyOpen or ClosedStart DateResolution DateTodayDays OpenDays To Done 
PLATTEAM-1820Open4/1/2024 9/25/20241770 
PLATTEAM-1820Open5/1/2024 9/25/20241470 
PLATTEAM-1820Closed6/1/20249/1/20249/25/2024092 
PLATTEAM-2110Closed7/15/20248/15/20249/25/2024031 
PLATTEAM-2110Open9/10/2024 9/25/2024150 
        
 Average Excluding Zero 11361.5 

 

I am using 

Start Date= CALCULATE(MIN(vwJiraEpicTimeStates[CreatedOnNext]),ALLEXCEPT(vwJiraEpicTimeStates,vwJiraEpicTimeStates[IssueKey]))
 
Resolution Date= CALCULATE(MAX(vwJiraEpicTimeStates[Resolution Date ]),ALLEXCEPT(vwJiraEpicTimeStates,vwJiraEpicTimeStates[IssueKey])
 
And I am using Two Measures with Date diff to get days to done and days open where appropriate but I cannot get the subtotals to work the measures. I would like to avoid having extra columns due to the size of the file .  
 
Is there any way to accomplish this using only measures?  Thanks!

 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks!

Two quick follow up questions

1) Basically the way I am interperting your response is that for every other column in the table, you would need to add that into the temp tabl  For instance, if you had 7 columns you would have to have summarize it by every category and tweak it every time you add or remove a column?

m_Total 4 =
VAR __table = SUMMARIZE('Table1',[Category1],[Category2],"__value",[m_Single])
RETURN
IF(HASONEVALUE(Table1[Category1]),[m_Single],SUMX(__table,[__value]))
 
2) If you really wanted to take any of those measure calculations and ignore any zeroes, how would that work?
Thanks

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.