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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
brokencornets
Helper IV
Helper IV

Not totalling Measure field

Hi all

 

My original query here was resolved: Solved: Filtering using date table not working how I would... - Microsoft Power BI Community

 

But following on from that, now I have a working measure at a line item level, I don't see to be able to sum this measure correctly?

 

I get why, because the calculation is counting the total number of days between a start/end date (365 in this case) and then dividing by the frequency x, so at a total level it'll still be calculating 365/(some form of x) - but how do I get around this and make the total sum up correctly?

 

Thanks in advance,

Phil

 

Measure:

Expected Iterations =
VAR maxdate= max('Date'[Date])
VAR mindate=max(min('Date'[Date]),min('Task List'[First Instance]))
RETURN
if(mindate>maxdate,0,
CALCULATE(datediff(mindate,maxdate,DAY),USERELATIONSHIP('Date'[Date],'Task List'[First Instance]))/sum('Task List'[Freq Days]))
 
Results:
brokencornets_0-1647444032232.png

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@brokencornets 

You will need to use SUMX to get the correct total.  It is probably easier to use your existing measure in a new one to handle all the context transition.  It will be along these lines.

 

Expected Iterations Correct Total = SUMX ( 'Task List', [Expected Iterations] )

 

 

Or, if a single task can be in the table multiple times it will be like this.

 

Expected Iterations Correct Total = SUMX ( VALUES('Task List'[Task ID]), [Expected Iterations] )

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@brokencornets 

You will need to use SUMX to get the correct total.  It is probably easier to use your existing measure in a new one to handle all the context transition.  It will be along these lines.

 

Expected Iterations Correct Total = SUMX ( 'Task List', [Expected Iterations] )

 

 

Or, if a single task can be in the table multiple times it will be like this.

 

Expected Iterations Correct Total = SUMX ( VALUES('Task List'[Task ID]), [Expected Iterations] )

 

 

Thanks @jdbuchanan71 - this works as a sum in the table but I can't use that new measure in a seperate card or it shows as 'Infinity' - any idea why that would be?

 

EDIT - Ignore this, I had a filter on the table visualisation but not on the card!

 

Thanks again for your help. Such a simple solution and yet it makes my head hurt.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.