cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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 🙂

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors