Showing results for 
Search instead for 
Did you mean: 
Post Patron
Post Patron

IF Statement



I have the following code that works just fine when calculating the difference between Case Start & Case End when there is only 1 row of data, but when there are 2 row the total is doubled: 22 x 2 = 44, the answer is 22




How can I modify this calculated column so that it doesn't double the Total Case Length? I know I can switch of the SUMMARISE feature in the visual but is there another way?

I am using a calculated column on purpose for this 


Total Case Length = 
    VAR _CaseStart = 'Deferrals'[Case Start]
    VAR _CaseEnd = 'Deferrals'[Case End]
    VAR _Table = FILTER(ALL('Date'),[Date] >= _CaseStart && [Date] <= _CaseEnd && [Is Working Day] = TRUE ())



Many thanks,


Super User
Super User

@ArchStanton , I think to do the total use summarize of values


Sumx(Values(Table[TIcket No]), [measure Total case length ])


I don't follow, what Values are you referring to in your example?

I tried a number of combinations and none of them work.

Also, I'm not using a measure because when I do I get the wrong result - I need a row context for this.

I would like to keep this as a calculated column if possible?




Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors