Forum Discussion

sarahgpm's avatar
sarahgpm
Icon for Microsoft Employee rankMicrosoft Employee
3 years ago

Measure is manipulating other data and calculating incorrectly

I created the following measure to calculate the duration between two dates:

 

PaddingLeft =
VAR OverallStartDate = [OverallStartDate]
VAR StartDate =
CALCULATE(
    MIN(IterationsCSV[Start Date]),
    REMOVEFILTERS(IterationsCSV)
)
VAR Result =
INT(StartDate - OverallStartDate)
RETURN Result
 
Even though my Start Date and End Date data is widely varied, the measure is calculating to zero across the board. So that is the main problem. In attempting to test it, I added Start Date and End Date to a table and the dates are showing as accurate:

 

But then when I add the PaddingLeft measure to the table, it changes all the dates in the table to be generic sequential and duplicates the Title row so there are 365 of each. This is inaccurate and essentially manipulating the source data in the query and I have no idea why it would do this. 

 

 

My main objective is to understand how to fix the PaddingLeft measure so that it calculates and displays correctly. Any help is much appreciated! My research efforts have turned up nothing that is helpful unfortunately.