cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Date time subtraction

Hello Pbix`ers,

Struglling with measure creation.

Have two subtract value lik ein picture?

2 REPLIES 2
Super User

@Ovidijus , Try like

new measure =
var _max = maxx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] < max(Table[Date])), Table[Date] )
return
sum( Table[Value]) - sumx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] = _max), Table[Value] )

or

new measure =
var _max = maxx(filter(allselected(Table), Table[Meter Number] = max(Table[Meter Number]) && Table[Date] < max(Table[Date])), Table[Date] )
return
sum( Table[Value]) - sumx(filter((Table), Table[Date] = _max), Table[Value] )

Frequent Visitor

Hey, solution probably would work but i played a little yesterday and need this visual as in the top table.

Need to see calculated values from Meters minus 12 hours.

That would be massive help to solve 🙂